neuray API Programmer's Manual

mi::neuraylib::IDictionary Class Reference

[Functors]

Description

The dictionary is a data structure that stores a mapping from a fixed set of keys to a their modifiable values. A key is represented as a string. The dictionary stores a value associated with a key. Such dictionaries are used to specify optional behavior of algorithms and data structures and for returning algorithm statistics.

The type of the dictionary values are from the set

  • const char*

  • bool

  • mi::Sint32

  • mi::Uint32

  • mi::Float32

  • mi::Float64

This data structure supports the lookup and the change of dictionary values. It does not support the manipulation of the keys itself. The intended use of this class is to obtain a default set of options from the API, e.g., all functors offer an mi::neuraylib::IFunctor_base::get_default_options() constmember function, and change the existing default values before passing the options to the algorithm or data structure.

Public Member Functions

virtual const char* get( const char* key, const char* default_value) const =0
Returns the value for the given key. More...
virtual bool  get( const char* key, bool default_value) const =0
Returns the value for the given key. More...
virtual Sint32 get( const char* key, Sint32 default_value) const =0
Returns the value for the given key. More...
virtual Uint32 get( const char* key, Uint32 default_value) const =0
Returns the value for the given key. More...
virtual Float32 get( const char* key, Float32 default_value) const =0
Returns the value for the given key. More...
virtual Float64 get( const char* key, Float64 default_value) const =0
Returns the value for the given key. More...
virtual bool  is_defined( const char* key) const =0
Returns true if and only if the given key exists.
virtual bool  is_invalid() const =0
Returns the invalidity flag of the dictionary. More...
virtual bool  set( const char* key, bool value) =0
Sets the value of the given key to the given value. More...
virtual bool  set( const char* key, const char* value) =0
Sets the value of the given key to the given value. More...
virtual bool  set( const char* key, Uint32 value) =0
Sets the value of the given key to the given value. More...
virtual bool  set( const char* key, Sint32 value) =0
Sets the value of the given key to the given value. More...
virtual bool  set( const char* key, Float32 value) =0
Sets the value of the given key to the given value. More...
virtual bool  set( const char* key, Float64 value) =0
Sets the value of the given key to the given value. More...

Member Functions

virtual const char* mi::​neuraylib::​IDictionary::get( const char* key, const char* default_value) const [pure virtual]

Returns the value for the given key. Returns default_value if the key does not exist.

virtual bool mi::​neuraylib::​IDictionary::get( const char* key, bool default_value) const [pure virtual]

Returns the value for the given key. Returns default_value if the key does not exist.

virtual Sint32 mi::​neuraylib::​IDictionary::get( const char* key, Sint32 default_value) const [pure virtual]

Returns the value for the given key. Returns default_value if the key does not exist.

virtual Uint32 mi::​neuraylib::​IDictionary::get( const char* key, Uint32 default_value) const [pure virtual]

Returns the value for the given key. Returns default_value if the key does not exist.

virtual Float32 mi::​neuraylib::​IDictionary::get( const char* key, Float32 default_value) const [pure virtual]

Returns the value for the given key. Returns default_value if the key does not exist.

virtual Float64 mi::​neuraylib::​IDictionary::get( const char* key, Float64 default_value) const [pure virtual]

Returns the value for the given key. Returns default_value if the key does not exist.

virtual bool mi::​neuraylib::​IDictionary::is_defined( const char* key) const [pure virtual]

Returns true if and only if the given key exists.

virtual bool mi::​neuraylib::​IDictionary::is_invalid() const [pure virtual]

Returns the invalidity flag of the dictionary. This flag may be raised, for instance, if a value of an unknown key has been tried to set.

virtual bool mi::​neuraylib::​IDictionary::set( const char* key, bool value) [pure virtual]

Sets the value of the given key to the given value. Attempts to set the value of an unknown key raise the invalidity flag and the dictionary becomes unusable for the corresponding algorithm. In this case, the key value is unchanged.

Parameters

key
The key whose value is to be changed.
value
The new value to be assigned.

Returns

Returns true on success, and false otherwise.

virtual bool mi::​neuraylib::​IDictionary::set( const char* key, const char* value) [pure virtual]

Sets the value of the given key to the given value. Attempts to set the value of an unknown key raise the invalidity flag and the dictionary becomes unusable for the corresponding algorithm. In this case, the key value is unchanged.

Parameters

key
The key whose value is to be changed.
value
The new value to be assigned.

Returns

Returns true on success, and false otherwise.

virtual bool mi::​neuraylib::​IDictionary::set( const char* key, Uint32 value) [pure virtual]

Sets the value of the given key to the given value. Attempts to set the value of an unknown key raise the invalidity flag and the dictionary becomes unusable for the corresponding algorithm. In this case, the key value is unchanged.

Parameters

key
The key whose value is to be changed.
value
The new value to be assigned.

Returns

Returns true on success, and false otherwise.

virtual bool mi::​neuraylib::​IDictionary::set( const char* key, Sint32 value) [pure virtual]

Sets the value of the given key to the given value. Attempts to set the value of an unknown key raise the invalidity flag and the dictionary becomes unusable for the corresponding algorithm. In this case, the key value is unchanged.

Parameters

key
The key whose value is to be changed.
value
The new value to be assigned.

Returns

Returns true on success, and false otherwise.

virtual bool mi::​neuraylib::​IDictionary::set( const char* key, Float32 value) [pure virtual]

Sets the value of the given key to the given value. Attempts to set the value of an unknown key raise the invalidity flag and the dictionary becomes unusable for the corresponding algorithm. In this case, the key value is unchanged.

Parameters

key
The key whose value is to be changed.
value
The new value to be assigned.

Returns

Returns true on success, and false otherwise.

virtual bool mi::​neuraylib::​IDictionary::set( const char* key, Float64 value) [pure virtual]

Sets the value of the given key to the given value. Attempts to set the value of an unknown key raise the invalidity flag and the dictionary becomes unusable for the corresponding algorithm. In this case, the key value is unchanged.

Parameters

key
The key whose value is to be changed.
value
The new value to be assigned.

Returns

Returns true on success, and false otherwise.