24 #include <co/dispatcher.h> 25 #include <co/localNode.h> 28 #include <lunchbox/bitOperation.h> 32 namespace detail {
class Object; }
34 typedef lunchbox::RefPtr< ObjectCM > ObjectCMPtr;
36 # define CO_COMMIT_NEXT LB_UNDEFINED_UINT32 67 CO_API
bool isAttached()
const;
82 CO_API
void setID(
const uint128_t& identifier );
85 CO_API
const uint128_t& getID()
const;
88 CO_API uint32_t getInstanceID()
const;
91 CO_API
bool isBuffered()
const;
97 CO_API
bool isMaster()
const;
124 {
return std::numeric_limits< uint64_t >::max(); }
135 CO_API
virtual CompressorInfo chooseCompressor()
const;
169 CO_API
void push(
const uint128_t& groupID,
const uint128_t& objectType,
170 const Nodes& nodes );
205 CO_API
virtual uint128_t commit(
const uint32_t incarnation =
217 CO_API
void setAutoObsolete(
const uint32_t count );
220 CO_API uint32_t getAutoObsolete()
const;
252 CO_API
virtual uint128_t sync(
const uint128_t& version = VERSION_HEAD );
255 CO_API uint128_t getHeadVersion()
const;
258 CO_API uint128_t getVersion()
const;
273 CO_API
virtual void notifyNewHeadVersion(
const uint128_t& version );
341 const uint32_t instanceID = CO_INSTANCE_ALL );
372 CO_API
virtual void notifyDetach();
387 uint32_t getMasterInstanceID()
const;
390 CO_API
NodePtr getMasterNode();
393 CO_API
void removeSlave(
NodePtr node,
const uint32_t instanceID );
394 CO_API
void removeSlaves(
NodePtr node );
395 void setMasterNode(
NodePtr node );
397 void addInstanceDatas(
const ObjectDataIStreamDeque&,
const uint128_t&);
411 const uint32_t masterInstanceID );
414 CO_API
virtual void attach(
const uint128_t&
id,
415 const uint32_t instanceID );
420 CO_API
virtual void detach();
423 void transfer(
Object* from );
425 void applyMapData(
const uint128_t& version );
426 void sendInstanceData(
const Nodes& nodes );
434 Object& operator = (
const Object& ) {
return *
this; }
437 CO_API
explicit Object(
const Object& );
440 detail::Object*
const impl_;
441 void _setChangeManager( ObjectCMPtr cm );
443 ObjectCMPtr _getChangeManager();
444 friend class ObjectStore;
446 LB_TS_VAR( _thread );
450 CO_API std::ostream& operator << ( std::ostream&,
const Object& );
459 { byteswap( reinterpret_cast< uint32_t& >( value )); }
461 #endif // CO_OBJECT_H virtual void notifyAttach()
Notify that this object will be registered or mapped.
virtual void notifyAttached()
Notify that this object has been registered or mapped.
A class for sending commands and data to local & external objects.
lunchbox::RefPtr< LocalNode > LocalNodePtr
A reference pointer for LocalNode pointers.
ChangeType
Object change handling characteristics, see Programming Guide.
virtual ChangeType getChangeType() const
virtual void notifyDetached()
Notify that this object has been deregistered or unmapped.
virtual void pack(DataOStream &os)
Serialize the modifications since the last call to commit().
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
A std::ostream-like interface for object serialization.
Object-oriented network library.
non-versioned, unbuffered, static object.
virtual void notifyNewVersion()
Notification that a new version was received by a master object.
virtual uint64_t getMaxVersions() const
Limit the number of queued versions on slave instances.
virtual void getInstanceData(DataOStream &os)
Serialize all instance information of this distributed object.
virtual bool isDirty() const
Return if this object needs a commit.
Defines version macros and class for library Collage.
virtual void applyInstanceData(DataIStream &is)
Deserialize the instance data.
A std::istream-like input data stream for binary data.
std::vector< NodePtr > Nodes
A vector of NodePtr's.
virtual void unpack(DataIStream &is)
Deserialize a change.
A class providing command dispatch functionality to networked objects.