24 #include <co/dispatcher.h> 25 #include <co/localNode.h> 36 typedef lunchbox::RefPtr<ObjectCM> ObjectCMPtr;
38 #define CO_COMMIT_NEXT LB_UNDEFINED_UINT32 69 CO_API
bool isAttached()
const;
84 CO_API
void setID(
const uint128_t& identifier);
87 CO_API
const uint128_t& getID()
const;
90 CO_API uint32_t getInstanceID()
const;
93 CO_API
bool isBuffered()
const;
99 CO_API
bool isMaster()
const;
126 return std::numeric_limits<uint64_t>::max();
138 CO_API
virtual CompressorInfo chooseCompressor()
const;
171 CO_API
void push(
const uint128_t& groupID,
const uint128_t& objectType,
207 CO_API
virtual uint128_t commit(
208 const uint32_t incarnation = CO_COMMIT_NEXT);
219 CO_API
void setAutoObsolete(
const uint32_t count);
222 CO_API uint32_t getAutoObsolete()
const;
254 CO_API
virtual uint128_t sync(
const uint128_t& version = VERSION_HEAD);
257 CO_API uint128_t getHeadVersion()
const;
260 CO_API uint128_t getVersion()
const;
275 CO_API
virtual void notifyNewHeadVersion(
const uint128_t& version);
340 const uint32_t instanceID = CO_INSTANCE_ALL);
369 CO_API
virtual void notifyDetach();
384 uint32_t getMasterInstanceID()
const;
387 CO_API
NodePtr getMasterNode();
390 CO_API
void removeSlave(
NodePtr node,
const uint32_t instanceID);
391 CO_API
void removeSlaves(
NodePtr node);
392 void setMasterNode(
NodePtr node);
394 void addInstanceDatas(
const ObjectDataIStreamDeque&,
const uint128_t&);
408 const uint32_t masterInstanceID);
411 CO_API
virtual void attach(
const uint128_t&
id,
const uint32_t instanceID);
416 CO_API
virtual void detach();
419 void transfer(
Object* from);
421 void applyMapData(
const uint128_t& version);
422 void sendInstanceData(
const Nodes& nodes);
432 CO_API
explicit Object(
const Object&);
435 detail::Object*
const impl_;
436 void _setChangeManager(ObjectCMPtr cm);
438 ObjectCMPtr _getChangeManager();
439 friend class ObjectStore;
445 CO_API std::ostream& operator<<(std::ostream&,
const Object&);
451 #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().
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.
std::vector< NodePtr > Nodes
A vector of NodePtr's.
virtual bool isDirty() const
Return if this object needs a commit.
Defines version macros and class for library Collage.
Object & operator=(const Object &)
NOP assignment operator.
virtual void applyInstanceData(DataIStream &is)
Deserialize the instance data.
A std::istream-like input data stream for binary data.
virtual void unpack(DataIStream &is)
Deserialize a change.
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
A class providing command dispatch functionality to networked objects.