NVIDIA Iray API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::IData_collection Class Referenceabstract

This interface represents collections. More...

Inheritance diagram for mi::IData_collection:
Inheritance graph
[legend]

Public Member Functions

virtual Size  get_length () const =0
  Returns the number of values. More...
 
virtual const char *  get_key (Size index) const =0
  Returns the key corresponding to index. More...
 
virtual bool  has_key (const char *key) const =0
  Indicates whether the key key exists or not. More...
 
virtual const base::IInterface get_value (const char *key) const =0
  Returns the value for key key. More...
 
template<class T >
const T *  get_value (const char *key) const
  Returns the value for key key. More...
 
virtual base::IInterface get_value (const char *key)=0
  Returns the value for key key. More...
 
template<class T >
T *  get_value (const char *key)
  Returns the value for key key. More...
 
virtual const base::IInterface get_value (Size index) const =0
  Returns the value for index index. More...
 
template<class T >
const T *  get_value (Size index) const
  Returns the value for index index. More...
 
virtual base::IInterface get_value (Size index)=0
  Returns the value for index index. More...
 
template<class T >
T *  get_value (Size index)
  Returns the value for index index. More...
 
virtual Sint32  set_value (const char *key, base::IInterface *value)=0
  Stores the value for key key. More...
 
virtual Sint32  set_value (Size index, base::IInterface *value)=0
  Stores the value for index index. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x1bb2be0f, 0x0dc6, 0x44b2, 0x93, 0xb9, 0xd1, 0xba, 0x6a, 0x31, 0x88, 0x1c, IData >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11, IData
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< 0x1bb2be0f, 0x0dc6, 0x44b2, 0x93, 0xb9, 0xd1, 0xba, 0x6a, 0x31, 0x88, 0x1c, IData >
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 collections.

All collections are derived from this interface which exposes a generic way to access the data via a key-value or index-value approach. Collections represent an ordered sequence of values. Collections may be typed (all values are of the same type) or untyped.

See Types for description of the type system.

In general, the sets of keys is fixed (additional methods on specific interfaces might insert new keys, e.g., mi::IMap::insert()) and type-specific.

Note that the interface pointers returned from all variants of get_value() are not distinct copies of the values stored inside the collection, but represent the value actually stored in the collection. It is not specified whether the methods set_value() copy the value in their argument or not.

See Also
mi::IData_simple

Member Function Documentation

virtual const char* mi::IData_collection::get_key ( Size  index) const
pure virtual

Returns the key corresponding to index.

Returns
The key, or NULL in case of failure.
virtual Size mi::IData_collection::get_length ( ) const
pure virtual

Returns the number of values.

Implemented in mi::ICompound, mi::IMap, and mi::IArray.

virtual const base::IInterface* mi::IData_collection::get_value ( const char *  key) const
pure virtual

Returns the value for key key.

Note
If a literal 0 is passed for key, the call is ambiguous. You need to explicitly cast the argument to const char*.
template<class T >
const T* mi::IData_collection::get_value ( const char *  key) const
inline

Returns the value for key key.

Note
If a literal 0 is passed for key, the call is ambiguous. You need to explicitly cast the argument to const char*.

This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid&) on the returned pointer, since the return type already is a pointer to the type T specified as template parameter.

Template Parameters
T The interface type of the element to return.
virtual base::IInterface* mi::IData_collection::get_value ( const char *  key)
pure virtual

Returns the value for key key.

Note
If a literal 0 is passed for key, the call is ambiguous. You need to explicitly cast the argument to const char*.
template<class T >
T* mi::IData_collection::get_value ( const char *  key)
inline

Returns the value for key key.

Note
If a literal 0 is passed for key, the call is ambiguous. You need to explicitly cast the argument to const char*.

This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid&) on the returned pointer, since the return type already is a pointer to the type T specified as template parameter.

Template Parameters
T The interface type of the element to return.
virtual const base::IInterface* mi::IData_collection::get_value ( Size  index) const
pure virtual

Returns the value for index index.

Note
If a literal 0 is passed for index, the call is ambiguous. You need to explicitly cast the argument to mi::Size.
template<class T >
const T* mi::IData_collection::get_value ( Size  index) const
inline

Returns the value for index index.

Note
If a literal 0 is passed for index, the call is ambiguous. You need to explicitly cast the argument to mi::Size.

This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid&) on the returned pointer, since the return type already is a pointer to the type T specified as template parameter.

Template Parameters
T The interface type of the element to return.
virtual base::IInterface* mi::IData_collection::get_value ( Size  index)
pure virtual

Returns the value for index index.

Note
If a literal 0 is passed for index, the call is ambiguous. You need to explicitly cast the argument to mi::Size.
template<class T >
T* mi::IData_collection::get_value ( Size  index)
inline

Returns the value for index index.

Note
If a literal 0 is passed for index, the call is ambiguous. You need to explicitly cast the argument to mi::Size.

This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid&) on the returned pointer, since the return type already is a pointer to the type T specified as template parameter.

Template Parameters
T The interface type of the element to return.
virtual bool mi::IData_collection::has_key ( const char *  key) const
pure virtual

Indicates whether the key key exists or not.

virtual Sint32 mi::IData_collection::set_value ( const char *  key,
base::IInterface value 
)
pure virtual

Stores the value for key key.

Note that it is not possible to create new keys.

Note
If a literal 0 is passed for key, the call is ambiguous. You need to explicitly cast the argument to const char*.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: Invalid key.
  • -3: value has the wrong type.
virtual Sint32 mi::IData_collection::set_value ( Size  index,
base::IInterface value 
)
pure virtual

Stores the value for index index.

Note that it is not possible to create new indices.

Note
If a literal 0 is passed for index, the call is ambiguous. You need to explicitly cast the argument to mi::Size.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: Invalid index.
  • -3: value has the wrong type.