Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::IEnum Class Referenceabstract

This interface represents enums. More...

Inheritance diagram for mi::IEnum:
mi::base::Interface_declare< 0x4e10d0e4, 0x456b, 0x45a5, 0xa6, 0xa7, 0xdf, 0x0a, 0xa1, 0x9a, 0x0c, 0xd2, IData_simple > mi::IData_simple mi::base::Interface_declare< 0xc33c5a05, 0xe7a5, 0x4154, 0xb8, 0x87, 0xee, 0x1f, 0x4d, 0x5b, 0x02, 0x02, IData > mi::IData mi::base::Interface_declare< 0x2e5f84bc, 0x783a, 0x4551, 0x9f, 0xca, 0x72, 0x2f, 0xb8, 0x38, 0xc4, 0x7c > mi::base::IInterface

Public Member Functions

virtual void get_value (Sint32 &value) const =0
 Returns the value of the enum as value of the corresponding enumerator. More...
 
Sint32 get_value () const
 Returns the value of the enum as value of the corresponding enumerator. More...
 
virtual const char * get_value_by_name () const =0
 Returns the value of the enum as name of the enumerator. More...
 
virtual Sint32 set_value (Sint32 value)=0
 Sets the enum via the value of an enumerator. More...
 
virtual Sint32 set_value_by_name (const char *name)=0
 Sets the enum via the name of an enumerator. More...
 
virtual const IEnum_declget_enum_decl () const =0
 Returns the enum declaration for this enum. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x4e10d0e4, 0x456b, 0x45a5, 0xa6, 0xa7, 0xdf, 0x0a, 0xa1, 0x9a, 0x0c, 0xd2, IData_simple >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IData_simple
Self
 Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x4e10d0e4, 0x456b, 0x45a5, 0xa6, 0xa7, 0xdf, 0x0a, 0xa1, 0x9a, 0x0c, 0xd2, IData_simple >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

This interface represents enums.

Enums are based on an enum declaration which defines the enumerators of the enum (their names and values). The type name of an enum is the name that was used to register its enum declaration. This type name can be used to create instances of a particular enum declaration (note that "Enum" itself is not a valid type name as it does not contain any information about a concrete enum type).

Note
The value returned by mi::IData::get_type_name() might start with '{' which indicates that it has been automatically generated. In this case the type name should be treated as an opaque string since its format might change unexpectedly. It is perfectly fine to pass it to other methods, e.g., mi::neuraylib::IFactory::create(), but you should not attempt to interpret the value in any way. Use get_enum_decl() to obtain information about the type itself.
See Also
mi::IEnum_decl

Member Function Documentation

virtual const IEnum_decl* mi::IEnum::get_enum_decl ( ) const
pure virtual

Returns the enum declaration for this enum.

virtual void mi::IEnum::get_value ( Sint32 value) const
pure virtual

Returns the value of the enum as value of the corresponding enumerator.

See Also
get_value_by_name()
Sint32 mi::IEnum::get_value ( ) const
inline

Returns the value of the enum as value of the corresponding enumerator.

See Also
get_value_by_name()
virtual const char* mi::IEnum::get_value_by_name ( ) const
pure virtual

Returns the value of the enum as name of the enumerator.

See Also
get_value()
virtual Sint32 mi::IEnum::set_value ( Sint32  value)
pure virtual

Sets the enum via the value of an enumerator.

See Also
set_value_by_name()
Parameters
valueThe new enumerator, specified by its value. If there are multiple enumerators with the same value the one with the smallest index in the corresponding enum declaration is chosen.
Returns
  • 0: Success.
  • -1: This enum type has no enumerator with value value.
virtual Sint32 mi::IEnum::set_value_by_name ( const char *  name)
pure virtual

Sets the enum via the name of an enumerator.

See Also
set_value()
Parameters
nameThe new enumerator, specified by its name.
Returns
  • 0: Success.
  • -1: This enum type has no enumerator with name name.