neuray API Programmer's Manual

mi::neuraylib::IType_enum Class Reference

[MDL type system]

Description

A type of kind enum.

Public Enumerations

enum Predefined_id{ EID_USER = -1, EID_TEX_GAMMA_MODE = 0, EID_INTENSITY_MODE = 1, EID_FORCE_32_BIT = 0x7fffffff}
IDs to distinguish predefined enum types.

Public Member Functions

virtual Size find_value( const char* name) const =0
Returns the index of a value in linear time. More...
virtual Size find_value( Sint32 code) const =0
Returns the index of a value in linear time. More...
virtual const IAnnotation_blockget_annotations() const =0
Returns the annotations of the enum type. More...
virtual Predefined_id get_predefined_id() const =0
If this enum is a predefined one, return its ID, else EID_USER.
virtual Size get_size() const =0
Returns the number of values.
virtual const char* get_symbol() const =0
Returns the qualified name of this enum type.
virtual const IAnnotation_blockget_value_annotations( Size index) const =0
Returns the annotations of a value. More...
virtual Sint32 get_value_code( Size index, Sint32* errors = 0) const =0
Returns the code of a value. More...
virtual const char* get_value_name( Size index) const =0
Returns the name of a value. More...

Static Public Variables

static const Kind s_kind = TK_ENUM
The kind of this subclass.

Enums

enum mi::​neuraylib::​IType_enum::Predefined_id

IDs to distinguish predefined enum types.

Enumerator:

EID_USER = -1
A user-defined enum type.
EID_TEX_GAMMA_MODE = 0
The "::tex::gamma_mode" enum type.
EID_INTENSITY_MODE = 1
The "::intensity_mode" enum type.
EID_FORCE_32_BIT = 0x7fffffff

Member Functions

virtual Size mi::​neuraylib::​IType_enum::find_value( const char* name) const [pure virtual]

Returns the index of a value in linear time.

Parameters

name
The unqualified name of the value.

Returns

The index of the value, or -1 if there is no such value.

virtual Size mi::​neuraylib::​IType_enum::find_value( Sint32 code) const [pure virtual]

Returns the index of a value in linear time.

Parameters

code
The code of the value.

Returns

The index of the value, or -1 if there is no such value.

virtual const IAnnotation_block* mi::​neuraylib::​IType_enum::get_annotations() const [pure virtual]

Returns the annotations of the enum type.

Returns

The annotations of the enum type, or NULL if there are no annotations for the enum type.

virtual Predefined_id mi::​neuraylib::​IType_enum::get_predefined_id() const [pure virtual]

If this enum is a predefined one, return its ID, else EID_USER.

virtual Size mi::​neuraylib::​IType_enum::get_size() const [pure virtual]

Returns the number of values.

virtual const char* mi::​neuraylib::​IType_enum::get_symbol() const [pure virtual]

Returns the qualified name of this enum type.

virtual const IAnnotation_block* mi::​neuraylib::​IType_enum::get_value_annotations( Size index) const [pure virtual]

Returns the annotations of a value.

Parameters

index
The index of the value.

Returns

The annotation of that value, or NULL if index is out of bounds, or there are no annotations for that value.

virtual Sint32 mi::​neuraylib::​IType_enum::get_value_code( Size index, Sint32* errors = 0) const [pure virtual]

Returns the code of a value.

Parameters

index
The index of the value.
errors
  • 0: Success.
  • -1: index is invalid.

Returns

The code of the value, or 0 in case of errors.

virtual const char* mi::​neuraylib::​IType_enum::get_value_name( Size index) const [pure virtual]

Returns the name of a value.

Parameters

index
The index of the value.

Returns

The unqualified name of the value, or NULL if index is invalid.

Variables

const Kind mi::​neuraylib::​IType_enum::s_kind = TK_ENUM [static]

The kind of this subclass.