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

The object receiver is responsible for creation and destruction of objects on the remote host. More...

#include <idistcache.h>

Inheritance diagram for mi::neuraylib::IObject_receiver:

Public Member Functions

virtual Uint64 create_object (base::Uuid class_id, IDeserializer *deserializer)=0
 Callback for object creation. More...
 
virtual void destroy_object (Uint64 id, bool owner_died)=0
 Callback for object destruction. 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< 0x61820375, ... >
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< 0x61820375, ... >
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

The object receiver is responsible for creation and destruction of objects on the remote host.

The distributed cache can handle an arbitrary number of such receivers, but at most one receiver per class ID.

Member Function Documentation

 create_object()

virtual Uint64 mi::neuraylib::IObject_receiver::create_object ( base::Uuid  class_id,
IDeserializer deserializer 
)
pure virtual

Callback for object creation.

This method is called on each remote host in the cluster or network when some host stores an object in the distributed cache.

Note that the data available from the deserializer was written by calling the serialize() function on the object passed to the mi::neuraylib::IDistributed_cache::store_object() function. That means that the cache guarantees that the deserializer here is in a state that a call to the deserialize() function of the correct class for the given class ID would work correctly.

Parameters
class_idThe class ID of the object, used to find the receiver and to tell the receiver which object to create.
deserializerThe receiver can read the data from this deserializer.
Returns
A unique object ID assigned by the creator which identifies the object and will be passed into the destroy_object() call.

 destroy_object()

virtual void mi::neuraylib::IObject_receiver::destroy_object ( Uint64  id,
bool  owner_died 
)
pure virtual

Callback for object destruction.

This method is called on those remote hosts which have received a corresponding create_object() call before. It will be called when either the owner removes the object or when the owner leaves the network.

Parameters
idThe object ID assigned by the receiver and returned from a previous create_object() call.
owner_diedA flag indicating whether the object was removed or the owner died.