The interface for creating types. More...
#include <itype.h>
Public Member Functions | |
Struct categories | |
virtual const IStruct_category * | create_struct_category (const char *symbol) const =0 |
Returns a registered struct category, or nullptr if symbol is invalid or unknown. More... | |
virtual IStruct_category_list * | create_struct_category_list () const =0 |
Creates a new struct category list. More... | |
virtual const IStruct_category * | get_predefined_struct_category (IStruct_category::Predefined_id id) const =0 |
Returns a registered struct category, or nullptr if id is unknown. More... | |
virtual IStruct_category_list * | clone (const IStruct_category_list *struct_category_list) const =0 |
Clones the given struct category list. More... | |
virtual Sint32 | compare (const IStruct_category *lhs, const IStruct_category *rhs) const =0 |
Compares two instances of mi::neuraylib::IStruct_category. More... | |
virtual Sint32 | compare (const IStruct_category_list *lhs, const IStruct_category_list *rhs) const =0 |
Compares two instances of mi::neuraylib::IStruct_category_list. More... | |
virtual const IString * | dump (const IStruct_category *struct_category, Size depth=0) const =0 |
Returns a textual representation of a struct category. More... | |
virtual const IString * | dump (const IStruct_category_list *list, Size depth=0) const =0 |
Returns a textual representation of a struct category list. More... | |
Creation of struct categories, 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 nullptr 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 nullptr 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 list. More... | |
virtual const IType_enum * | get_predefined_enum (IType_enum::Predefined_id id) const =0 |
Returns a registered enum type, or nullptr 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 nullptr 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 *lhs, const IType *rhs) const =0 |
Checks whether two types are (cast-)compatible, i.e. More... | |
virtual Sint32 | from_same_struct_category (const IType *lhs, const IType *rhs) const =0 |
Checks whether two types are from the same struct category, i.e., lhs can be decl-cast to rhs . 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... | |
![]() | |
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 | |
![]() | |
using | Self = Interface_declare< id1, ... > |
Own type. More... | |
using | IID = Uuid_t< id1, ... > |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
using | IID = Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
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 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 struct category list.
const
and there is no scenario where cloning of a struct category makes sense.
|
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::IStruct_category.
The result is determined by 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::IStruct_category_list.
The comparison operator for instances of mi::neuraylib::IStruct_category_list is defined as follows:
lhs
or rhs
is nullptr
, 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 |
Compares two instances of mi::neuraylib::IType.
The comparison operator for instances of mi::neuraylib::IType is defined as follows:
lhs
or rhs
is nullptr
, 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 nullptr
, 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). |
nullptr
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 nullptr
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. |
nullptr
in case of errors.
|
pure virtual |
Creates a new instance of the string type.
|
pure virtual |
Returns a registered struct type, or nullptr
if symbol
is invalid or unknown.
|
pure virtual |
Returns a registered struct category, or nullptr
if symbol
is invalid or unknown.
|
pure virtual |
Creates a new struct category list.
|
pure virtual |
Creates a new instance of the type texture.
|
pure virtual |
Creates a new type list.
|
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. |
nullptr
in case of errors.
|
pure virtual |
Returns a textual representation of a struct category.
|
pure virtual |
Returns a textual representation of a struct category list.
The representation of the struct category 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 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 |
Checks whether two types are from the same struct category, i.e., lhs
can be decl-cast to rhs
.
lhs | The first type. |
rhs | The second type. |
lhs
and rhs
are from the same struct category, but different types.lhs
and rhs
are identical types.lhs
and rhs
are from different struct categories (including struct types without struct category, or no struct types).
|
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 nullptr
if id
is unknown.
|
pure virtual |
Returns a registered struct type, or nullptr
if id
is unknown.
|
pure virtual |
Returns a registered struct category, or nullptr
if id
is unknown.
|
pure virtual |
Checks whether two types are (cast-)compatible, i.e.
that lhs
can be cast to rhs
.
lhs
is compatible with and therefore can be cast to rhs
, if
lhs
and rhs
are of identical type (see mi::neuraylib::IType_factory::compare()).lhs
and rhs
are of type mi::neuraylib::IType_struct, are conventional structs, have the same number of fields and all fields are pairwise compatible. The names of the fields do not matter, only their order.lhs
and rhs
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.lhs
and rhs
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.lhs | The first type. |
rhs | The second type. |
lhs
and rhs
are compatible, but different types.lhs
and rhs
are identical types (and therefore compatible).lhs
and rhs
are not compatible.