mi::neuraylib::IUser_class Class Reference
[Extensions and Plugins]
Description
Abstract interface for user-defined classes. All user-defined classes have to be derived from this interface. The mixing mi::neuraylib::User_class is helpful to implement this interface (or interfaces derived from it). User-defined classes have to be registered via mi::neuraylib::IExtension_api::register_class().
Public Member Functions
- virtual IUser_class* copy() const =0
- Creates a copy of the database element. More...
- virtual const char* get_class_name() const =0
- Returns a human readable identifier for the class this database element belongs to. More...
- virtual IArray* get_references( ITransaction* transaction) const =0
- Returns the list of elements referenced by this element. More...
Member Functions
- virtual IUser_class* mi::neuraylib::IUser_class::copy() const [pure virtual]
-
Creates a copy of the database element. Duplicating a database element is used by the database when it needs to create a new version of the given element, e.g., when someone edits an existing element. This member function must create and return a full copy of the element.
Returns
A newly allocated instance of the database element. The pointer represents a complete replica of the database element on which the member function was called and is owned by the database.
- virtual const char* mi::neuraylib::IUser_class::get_class_name() const [pure virtual]
-
Returns a human readable identifier for the class this database element belongs to. This name is not required for proper operation, but can be useful for debugging. For example, the name is used to display the class name in the tag table of the HTTP administration console.
Returns
The class name.
- virtual IArray* mi::neuraylib::IUser_class::get_references( ITransaction* transaction) const [pure virtual]
-
Returns the list of elements referenced by this element. The database ensures that elements will not be removed from the database as long as they are referenced by other elements, even if they have been scheduled for removal by mi::neuraylib::ITransaction::remove().
Parameters
- transaction
- A transaction that can be used to create the return value or temporary values.
Returns
An array of strings, where each string is the name of a referenced element. Can be NULL if the element does not refer other elements.