DiCE API nvidia_logo_transpbg.gif Up
mi::neuraylib::IElement Class Referenceabstract

This interface represents the abstract base class for all database elements. More...

#include <dice.h>

Inheritance diagram for mi::neuraylib::IElement:

Public Member Functions

virtual IElementcopy () 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 void get_references (ITag_set *result) const =0
 Returns the set of referenced tags for reference counting. More...
 
virtual Size get_size () const =0
 Returns the size of the database element in bytes. More...
 
virtual bool get_send_to_all_nodes () const =0
 Indicates how the database element should be distributed in the cluster. More...
 
virtual bool get_offload_to_disk () const =0
 Indicates how the database element is handled when received via the network without being explicitly requested. More...
 
- Public Member Functions inherited from mi::neuraylib::ISerializable
virtual base::Uuid get_class_id () const =0
 Returns the class ID of the object. More...
 
virtual void serialize (ISerializer *serializer) const =0
 Serializes the object to the given serializer. More...
 
virtual void deserialize (IDeserializer *deserializer)=0
 Deserializes the object from the given deserializer. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_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 IInterfaceget_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

- Public Types inherited from mi::base::Interface_declare< 0x3f377a88, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x7a70f2fb, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x3f377a88, ... >
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 Public Member Functions inherited from mi::base::Interface_declare< 0x7a70f2fb, ... >
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 Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

This interface represents the abstract base class for all database elements.

Each database element must be derived from this interface and the pure virtual methods must be implemented.

See also
The mixin mi::neuraylib::Element can be useful as a starting point for your own implementation of this abstract interface.

Member Function Documentation

 copy()

virtual IElement * mi::neuraylib::IElement::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.

 get_class_name()

virtual const char * mi::neuraylib::IElement::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. The string has to be valid at all times while instances of this class are stored in the database.

 get_offload_to_disk()

virtual bool mi::neuraylib::IElement::get_offload_to_disk ( ) const
pure virtual

Indicates how the database element is handled when received via the network without being explicitly requested.

If the method returns false, a host that receives such a database element will make no difference between an explicit request or an accidental reception, e.g., because the element was multicasted. If the method returns true, the database will be more conservative w.r.t. memory usage for elements that it received by accident. The element will be discarded if the host is not required to keep it for redundancy reasons or if the element represents the result of a database job. Next, if the disk cache is operational, the element will be offloaded to disk. Finally, in all other cases, the element will be kept in memory, as if the element was explicitly requested.

See also
mi::neuraylib::IDatabase_configuration::set_disk_swapping(), mi::neuraylib::IDatabase_configuration::get_disk_swapping()

 get_references()

virtual void mi::neuraylib::IElement::get_references ( ITag_set result) const
pure virtual

Returns the set of referenced tags for reference counting.

The tag set allows reference counting to control the lifetime of database elements. If a tag is contained in this set it is guaranteed that the database element identified by that tag is alive as long as the current version of this database elements exists.

Parameters
[out]resultThe set of tags referenced by the database element. The passed-in tag set is empty.

 get_send_to_all_nodes()

virtual bool mi::neuraylib::IElement::get_send_to_all_nodes ( ) const
pure virtual

Indicates how the database element should be distributed in the cluster.

If the method returns true the stored or edited database element is distributed to all nodes in the cluster. If the method returns false the database element is only distributed to the owners, i.e., a subset of the nodes as required to fulfill the configured redundancy. (Of course, it is later also distributed to those nodes that explicitly access the database element.)

See also
mi::neuraylib::INetwork_configuration::set_redundancy_level().

 get_size()

virtual Size mi::neuraylib::IElement::get_size ( ) const
pure virtual

Returns the size of the database element in bytes.

The value includes all memory that directly or indirectly belongs exclusively to this database element. For simple classes,

sizeof(*this)

works.

A correct implementation of this method is required if memory limits are configured.

See also
mi::neuraylib::IDatabase_configuration::set_memory_limits(), mi::neuraylib::IDatabase_configuration::get_memory_limits()