neuray API Programmer's Manual

mi::neuraylib::IType_list Class Reference

[MDL type system]

Description

An ordered collection of types identified by name or index. Type lists can be created with mi::neuraylib::IType_factory::create_type_list().

Public Member Functions

virtual Sint32 add_type( const char* name, const IType* type) =0
Adds a type at the end of the list. More...
virtual Size get_index( const char* name) const =0
Returns the index for the given name, or -1 if there is no such type.
virtual const char* get_name( Size index) const =0
Returns the name for the given index, or NULL if there is no such type.
virtual Size get_size() const =0
Returns the number of elements.
virtual const ITypeget_type( Size index) const =0
Returns the type for index, or NULL if there is no such type.
template< class T>const T* get_type( Size index) const
Returns the type for index, or NULL if there is no such type.
virtual const ITypeget_type( const char* name) const =0
Returns the type for name, or NULL if there is no such type.
template< class T>const T* get_type( const char* name) const
Returns the type for name, or NULL if there is no such type.
virtual Sint32 set_type( Size index, const IType* type) =0
Sets a type at a given index. More...
virtual Sint32 set_type( const char* name, const IType* type) =0
Sets a type identified by name. More...

Member Functions

virtual Sint32 mi::​neuraylib::​IType_list::add_type( const char* name, const IType* type) [pure virtual]

Adds a type at the end of the list.

Returns

- 0: Success.

  • -1: Invalid parameters (NULL pointer).
  • -2: There is already a type mapped to name in the list.

virtual Size mi::​neuraylib::​IType_list::get_index( const char* name) const [pure virtual]

Returns the index for the given name, or -1 if there is no such type.

virtual const char* mi::​neuraylib::​IType_list::get_name( Size index) const [pure virtual]

Returns the name for the given index, or NULL if there is no such type.

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

Returns the number of elements.

virtual const IType* mi::​neuraylib::​IType_list::get_type( Size index) const [pure virtual]

Returns the type for index, or NULL if there is no such type.

template< class T>

const T* mi::​neuraylib::​IType_list::get_type( Size index) const [inline]

Returns the type for index, or NULL if there is no such type.

virtual const IType* mi::​neuraylib::​IType_list::get_type( const char* name) const [pure virtual]

Returns the type for name, or NULL if there is no such type.

template< class T>

const T* mi::​neuraylib::​IType_list::get_type( const char* name) const [inline]

Returns the type for name, or NULL if there is no such type.

virtual Sint32 mi::​neuraylib::​IType_list::set_type( Size index, const IType* type) [pure virtual]

Sets a type at a given index.

Returns

- 0: Success.

  • -1: Invalid parameters (NULL pointer).
  • -2: index is out of bounds.

virtual Sint32 mi::​neuraylib::​IType_list::set_type( const char* name, const IType* type) [pure virtual]

Sets a type identified by name.

Returns

- 0: Success.

  • -1: Invalid parameters (NULL pointer).
  • -2: There is no type mapped to name in the list.