DiCE API nvidia_logo_transpbg.gif Up
mi::IEnum Class Referenceabstract

This interface represents enums. More...

#include <ienum.h>

Inheritance diagram for mi::IEnum:

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...
 
- Public Member Functions inherited from mi::IData
virtual const char * get_type_name () const =0
 Returns the type name. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x4e10d0e4, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0xc33c5a05, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x2e5f84bc, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x4e10d0e4, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xc33c5a05, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x2e5f84bc, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. 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

 get_enum_decl()

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

Returns the enum declaration for this enum.

 get_value() [1/2]

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()

 get_value() [2/2]

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()

 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()

 set_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.

 set_value_by_name()

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.