The interface for creating types. More...
#include <itype.h>
Public Member Functions | |
Creation of types and type lists | |
virtual const IType_alias * | create_alias (const IType *type, Uint32 modifiers, const char *symbol) const =0 |
Creates a new instance of the type alias. More... | |
virtual const IType_bool * | create_bool () const =0 |
Creates a new instance of the type boolean. More... | |
virtual const IType_int * | create_int () const =0 |
Creates a new instance of the type int. More... | |
virtual const IType_enum * | create_enum (const char *symbol) const =0 |
Returns a registered enum type, or NULL if symbol is invalid or unknown. More... | |
virtual const IType_float * | create_float () const =0 |
Creates a new instance of the float type. More... | |
virtual const IType_double * | create_double () const =0 |
Creates a new instance of the double type. More... | |
virtual const IType_string * | create_string () const =0 |
Creates a new instance of the string type. More... | |
virtual const IType_vector * | create_vector (const IType_atomic *element_type, Size size) const =0 |
Creates a new instance of a vector type. More... | |
virtual const IType_matrix * | create_matrix (const IType_vector *column_type, Size columns) const =0 |
Creates a new instance of a matrix type. More... | |
virtual const IType_color * | create_color () const =0 |
Creates a new instance of the type color. More... | |
virtual const IType_array * | create_immediate_sized_array (const IType *element_type, Size size) const =0 |
Creates a new instance of an immediate-sized array type. More... | |
virtual const IType_array * | create_deferred_sized_array (const IType *element_type, const char *size) const =0 |
Creates a new instance of a deferred-sized array type. More... | |
virtual const IType_struct * | create_struct (const char *symbol) const =0 |
Returns a registered struct type, or NULL if symbol is invalid or unknown. More... | |
virtual const IType_texture * | create_texture (IType_texture::Shape shape) const =0 |
Creates a new instance of the type texture. More... | |
virtual const IType_light_profile * | create_light_profile () const =0 |
Creates a new instance of the type light_profile. More... | |
virtual const IType_bsdf_measurement * | create_bsdf_measurement () const =0 |
Creates a new instance of the type bsdf_measurement. More... | |
virtual const IType_bsdf * | create_bsdf () const =0 |
Creates a new instance of the type bsdf. More... | |
virtual const IType_hair_bsdf * | create_hair_bsdf () const =0 |
Creates a new instance of the type hair_bsdf. More... | |
virtual const IType_edf * | create_edf () const =0 |
Creates a new instance of the type edf. More... | |
virtual const IType_vdf * | create_vdf () const =0 |
Creates a new instance of the type vdf. More... | |
virtual IType_list * | create_type_list () const =0 |
Creates a new type map. More... | |
virtual const IType_enum * | get_predefined_enum (IType_enum::Predefined_id id) const =0 |
Returns a registered enum type, or NULL if id is unknown. More... | |
virtual const IType_struct * | get_predefined_struct (IType_struct::Predefined_id id) const =0 |
Returns a registered struct type, or NULL if id is unknown. More... | |
virtual const IType * | create_from_mdl_type_name (const char *name) const =0 |
Creates a type based on its MDL type name. More... | |
template<class T> | |
const T * | create_from_mdl_type_name (const char *name) const |
Creates a type based on its MDL type name. More... | |
Cloning of type lists | |
virtual IType_list * | clone (const IType_list *type_list) const =0 |
Clones the given type list. More... | |
Comparison of types and type lists | |
virtual Sint32 | compare (const IType *lhs, const IType *rhs) const =0 |
Compares two instances of mi::neuraylib::IType. More... | |
virtual Sint32 | compare (const IType_list *lhs, const IType_list *rhs) const =0 |
Compares two instances of mi::neuraylib::IType_list. More... | |
virtual Sint32 | is_compatible (const IType *src, const IType *dst) const =0 |
Checks, if two instances of mi::neuraylib::IType are compatible, meaning that src can be casted to dst . More... | |
Dumping of types and type lists | |
virtual const IString * | dump (const IType *type, Size depth=0) const =0 |
Returns a textual representation of a type. More... | |
virtual const IString * | dump (const IType_list *list, Size depth=0) const =0 |
Returns a textual representation of a type list. More... | |
Miscellaneous methods | |
virtual const IString * | get_mdl_module_name (const IType *type) const =0 |
Returns the MDL module name of the module which defines type . More... | |
virtual const IString * | get_mdl_type_name (const IType *type) const =0 |
Returns the MDL type name of a type. 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 IInterface * | get_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 IInterface * | get_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< 0x353803c0, ... > | |
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< 0x353803c0, ... > | |
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... | |
The interface for creating types.
A type factory can be obtained from mi::neuraylib::IMdl_factory::create_type_factory().
|
pure virtual |
Clones the given type list.
const
and there is no scenario where cloning of a type makes sense.
|
pure virtual |
Compares two instances of mi::neuraylib::IType.
The comparison operator for instances of mi::neuraylib::IType is defined as follows:
lhs
or rhs
is NULL
, the result is the lexicographic comparison of the pointer addresses themselves.operator<
on the mi::neuraylib::IType::Kind values.strcmp()
on the corresponding symbol names.lhs | The left-hand side operand for the comparison. |
rhs | The right-hand side operand for the comparison. |
lhs
< rhs
, 0 if lhs
== rhs
, and +1 if lhs
> rhs
.
|
pure virtual |
Compares two instances of mi::neuraylib::IType_list.
The comparison operator for instances of mi::neuraylib::IType_list is defined as follows:
lhs
or rhs
is NULL
, the result is the lexicographic comparison of the pointer addresses themselves.operator<()
.strcmp()
.lhs | The left-hand side operand for the comparison. |
rhs | The right-hand side operand for the comparison. |
lhs
< rhs
, 0 if lhs
== rhs
, and +1 if lhs
> rhs
.
|
pure virtual |
Creates a new instance of the type alias.
|
pure virtual |
Creates a new instance of the type boolean.
|
pure virtual |
Creates a new instance of the type bsdf.
|
pure virtual |
Creates a new instance of the type bsdf_measurement.
|
pure virtual |
Creates a new instance of the type color.
|
pure virtual |
Creates a new instance of a deferred-sized array type.
element_type | The type of the array elements. |
size | The size symbol, e.g., "N" . The actual value of the size symbol does not matter in most cases, e.g., for arguments. It does matter when constructing new functions and materials using the module builder (see mi::neuraylib::IMdl_module_builder). |
NULL
in case of errors.
|
pure virtual |
Creates a new instance of the double type.
|
pure virtual |
Creates a new instance of the type edf.
|
pure virtual |
Returns a registered enum type, or NULL
if symbol
is invalid or unknown.
|
pure virtual |
Creates a new instance of the float type.
|
inline |
Creates a type based on its MDL type name.
Contrary to MDL source code, whitespace is meaningful. In other words, only the strings produced by get_mdl_type_name() are supported here. For enums and structs, the corresponding module must have been loaded, such that these types are registered.
|
pure virtual |
Creates a type based on its MDL type name.
Contrary to MDL source code, whitespace is meaningful. In other words, only the strings produced by get_mdl_type_name() are supported here. For enums and structs, the corresponding module must have been loaded, such that these types are registered.
|
pure virtual |
Creates a new instance of the type hair_bsdf.
|
pure virtual |
Creates a new instance of an immediate-sized array type.
|
pure virtual |
Creates a new instance of the type int.
|
pure virtual |
Creates a new instance of the type light_profile.
|
pure virtual |
Creates a new instance of a matrix type.
column_type | The column type needs to be a vector of either mi::neuraylib::IType_float or mi::neuraylib::IType_double. |
columns | The number of columns, either 2, 3, or 4. |
NULL
in case of errors.
|
pure virtual |
Creates a new instance of the string type.
|
pure virtual |
Returns a registered struct type, or NULL
if symbol
is invalid or unknown.
|
pure virtual |
Creates a new instance of the type texture.
|
pure virtual |
Creates a new type map.
|
pure virtual |
Creates a new instance of the type vdf.
|
pure virtual |
Creates a new instance of a vector type.
element_type | The element type needs to be either mi::neuraylib::IType_bool, mi::neuraylib::IType_int, mi::neuraylib::IType_float, or mi::neuraylib::IType_double. |
size | The number of elements, either 2, 3, or 4. |
NULL
in case of errors.
|
pure virtual |
Returns a textual representation of a type.
The representation of the type might contain line breaks, for example for structures and enums. Subsequent lines have a suitable indentation. The assumed indentation level of the first line is specified by depth
.
|
pure virtual |
Returns a textual representation of a type list.
The representation of the type list will contain line breaks. Subsequent lines have a suitable indentation. The assumed indentation level of the first line is specified by depth
.
|
pure virtual |
Returns the MDL module name of the module which defines type
.
The module name is derived from the symbol of enum, struct, and alias types. For array types, the corresponding element type is considered. Frequency modifiers of alias types are ignored. Returns the name of the ::<builtins>
module for all other types.
Use mi::neuraylib::IMdl_factory::get_db_module_name() to compute the corresponding DB name.
|
pure virtual |
Returns the MDL type name of a type.
The MDL type name is:
::<builtins>
module, e.g., "material"
or "intensity_mode"
."uniform "
or "varying "
. Note that named aliases are not yet supported.
|
pure virtual |
Returns a registered enum type, or NULL
if id
is unknown.
|
pure virtual |
Returns a registered struct type, or NULL
if id
is unknown.
|
pure virtual |
Checks, if two instances of mi::neuraylib::IType are compatible, meaning that src
can be casted to dst
.
src
is compatible with and therefore can be casted to dst
, if
src
and dst
are of identical type (see mi::neuraylib::IType_factory::compare()).src
and dst
are of type mi::neuraylib::IType_struct, have the same number of fields and all fields are pairwise compatible. The names of the fields do not matter, only their order.src
and dst
are of type mi::neuraylib::IType_enum and both enumeration types have the same set of numerical enumeration values. The names of the enumeration values, their order, or whether multiple enumeration value names share the same numerical value do not matter.src
and dst
are of type mi::neuraylib::IType_array, both arrays are either immediate-sized or deferred-sized arrays, have the same size, and their element types are compatible.src | The source type. |
dst | the target type to which src is intended to be compatible. |
src
can be casted to dst
, but src
and dst
are not of identical type.src
and dst
are of identical type.src
cannot be casted to dst
.