Collage  1.7.0
High-performance C++ library for developing object-oriented distributed applications.
co::ObjectHandler Class Referenceabstract

Interface for entities which map and register objects. More...

#include <objectHandler.h>

+ Inheritance diagram for co::ObjectHandler:
+ Collaboration diagram for co::ObjectHandler:

Public Member Functions

virtual bool registerObject (Object *object)=0
 Register a distributed object. More...
 
virtual void deregisterObject (Object *object)=0
 Deregister a distributed object. More...
 
virtual uint32_t mapObjectNB (Object *object, const uint128_t &id, const uint128_t &version, NodePtr master)=0
 Start mapping a distributed object. More...
 
virtual bool mapObjectSync (const uint32_t requestID)=0
 Finalize the mapping of a distributed object. More...
 
virtual void unmapObject (Object *object)=0
 Unmap a mapped object. More...
 
CO_API void releaseObject (Object *object)
 Convenience method to deregister or unmap an object. More...
 
virtual f_bool_t syncObject (Object *object, const uint128_t &id, NodePtr master, const uint32_t instanceID=CO_INSTANCE_ALL)=0
 Synchronize the local object with a remote object. More...
 

Protected Member Functions

 ObjectHandler ()
 Construct a new object handler. More...
 
virtual ~ObjectHandler ()
 Destroy this object handler. More...
 

Detailed Description

Interface for entities which map and register objects.

Definition at line 29 of file objectHandler.h.

Constructor & Destructor Documentation

co::ObjectHandler::ObjectHandler ( )
inlineprotected

Construct a new object handler.

Version
1.0

Definition at line 102 of file objectHandler.h.

virtual co::ObjectHandler::~ObjectHandler ( )
inlineprotectedvirtual

Destroy this object handler.

Version
1.0

Definition at line 104 of file objectHandler.h.

Member Function Documentation

virtual void co::ObjectHandler::deregisterObject ( Object object)
pure virtual

Deregister a distributed object.

Parameters
objectthe object instance.
Version
1.0

Implemented in co::LocalNode.

virtual uint32_t co::ObjectHandler::mapObjectNB ( Object object,
const uint128_t &  id,
const uint128_t &  version,
NodePtr  master 
)
pure virtual

Start mapping a distributed object.

Parameters
objectthe object to map.
idthe object identifier
versionthe version to map.
masterthe master node, may be invalid/0.
Returns
the request identifier for mapObjectSync().
Version
1.0

Implemented in co::LocalNode.

virtual bool co::ObjectHandler::mapObjectSync ( const uint32_t  requestID)
pure virtual

Finalize the mapping of a distributed object.

Version
1.0

Implemented in co::LocalNode.

virtual bool co::ObjectHandler::registerObject ( Object object)
pure virtual

Register a distributed object.

Registering a distributed object makes this object the master version. The object's identifier is used to map slave instances of the object. Master versions of objects are typically writable and can commit new versions of the distributed object.

Parameters
objectthe object instance.
Returns
true if the object was registered, false otherwise.
Version
1.0

Implemented in co::LocalNode.

CO_API void co::ObjectHandler::releaseObject ( Object object)

Convenience method to deregister or unmap an object.

Version
1.0
virtual f_bool_t co::ObjectHandler::syncObject ( Object object,
const uint128_t &  id,
NodePtr  master,
const uint32_t  instanceID = CO_INSTANCE_ALL 
)
pure virtual

Synchronize the local object with a remote object.

The object is synchronized to the newest version of the first attached object on the given master node matching the instanceID. No mapping is established. When no master node is given, connectObjectMaster() is used to find the node with the master instance. When CO_INSTANCE_ALL is given, the first instance is used. Before a successful return, applyInstanceData() is called on the calling thread to synchronize the given object.

Parameters
objectThe local object instance to synchronize.
idthe object identifier.
masterThe node where the synchronizing object is attached.
instanceIDthe instance identifier of the synchronizing object.
Returns
A lunchbox::Future which will deliver the success status of the operation on evaluation.
Version
1.1.1

Implemented in co::LocalNode.

virtual void co::ObjectHandler::unmapObject ( Object object)
pure virtual

Unmap a mapped object.

Version
1.0

Implemented in co::LocalNode.


The documentation for this class was generated from the following file: