An object change manager handling only full versions for the master instance. More...
#include <fullMasterCM.h>


Classes | |
| struct | InstanceData |
Public Member Functions | |
| FullMasterCM (Object *object) | |
| virtual void | makeThreadSafe () |
| Make this object thread safe. | |
| virtual bool | isMaster () const |
| virtual uint32_t | getMasterInstanceID () const |
| virtual uint32_t | addSlave (Command &command) |
| Add a subscribed slave to the managed object. | |
| virtual void | removeSlave (NodePtr node) |
| Remove a subscribed slave. | |
| virtual const NodeVector * | getSlaveNodes () const |
| virtual void | addOldMaster (NodePtr node, const uint32_t instanceID) |
| Add the old master as a slave. | |
| virtual void | applyMapData () |
| Apply the initial data after mapping. | |
Versioning | |
| virtual uint32_t | commitNB () |
| Start committing a new version. | |
| virtual uint32_t | commitSync (const uint32_t commitID) |
| Finalize a commit transaction. | |
| virtual void | obsolete (const uint32_t version) |
| Explicitily obsolete all versions. | |
| virtual void | setAutoObsolete (const uint32_t count, const uint32_t flags) |
| Automatically obsolete old versions. | |
| virtual uint32_t | getAutoObsoleteCount () const |
| virtual uint32_t | sync (const uint32_t version) |
| Sync to a given version. | |
| virtual uint32_t | getHeadVersion () const |
| virtual uint32_t | getVersion () const |
| virtual uint32_t | getOldestVersion () const |
Protected Types | |
|
typedef std::deque < InstanceData * > | InstanceDataDeque |
|
typedef std::vector < InstanceData * > | InstanceDataVector |
Protected Member Functions | |
| InstanceData * | _newInstanceData () |
| void | _obsolete () |
| void | _checkConsistency () const |
| CommandResult | _cmdCommit (Command &pkg) |
| CommandResult | _cmdDiscard (Command &pkg) |
| CHECK_THREAD_DECLARE (_thread) | |
Protected Attributes | |
| Object * | _object |
| The managed object. | |
| NodeVector | _slaves |
| The list of subsribed slave nodes. | |
| base::UUIDHash< uint32_t > | _slavesCount |
| The number of object instances subscribed per slave node. | |
| uint32_t | _version |
| The current version. | |
| uint32_t | _commitCount |
| The number of commits, needed for auto-obsoletion. | |
| uint32_t | _nVersions |
| The number of old versions to retain. | |
| uint32_t | _obsoleteFlags |
| The flags for automatic version obsoletion. | |
| base::RequestHandler | _requestHandler |
| Registers request packets waiting for a return value. | |
| InstanceDataDeque | _instanceDatas |
| The list of full instance datas, head version last. | |
| InstanceDataVector | _instanceDataCache |
An object change manager handling only full versions for the master instance.
For internal use only.
Definition at line 41 of file fullMasterCM.h.
| virtual void eq::net::FullMasterCM::makeThreadSafe | ( | ) | [inline, virtual] |
Make this object thread safe.
The caller has to ensure that no other thread is using this object when this function is called. It is primarily used by the session during object instantiation.
Implements eq::net::ObjectCM.
Definition at line 47 of file fullMasterCM.h.
| uint32_t eq::net::FullMasterCM::commitNB | ( | ) | [virtual] |
Start committing a new version.
Implements eq::net::ObjectCM.
Definition at line 82 of file fullMasterCM.cpp.
References _object, _requestHandler, eq::net::Object::getLocalNode(), eq::base::RequestHandler::registerRequest(), and eq::net::Object::send().

| uint32_t eq::net::FullMasterCM::commitSync | ( | const uint32_t | commitID | ) | [virtual] |
Finalize a commit transaction.
| commitID | the commit identifier returned from commitNB |
Implements eq::net::ObjectCM.
Definition at line 92 of file fullMasterCM.cpp.
References _requestHandler, and eq::base::RequestHandler::waitRequest().

| virtual void eq::net::FullMasterCM::obsolete | ( | const uint32_t | version | ) | [inline, virtual] |
Explicitily obsolete all versions.
| version | the version to obsolete |
Implements eq::net::ObjectCM.
Definition at line 56 of file fullMasterCM.h.
| virtual void eq::net::FullMasterCM::setAutoObsolete | ( | const uint32_t | count, | |
| const uint32_t | flags | |||
| ) | [inline, virtual] |
Automatically obsolete old versions.
| count | the number of versions to retain, excluding the head version. | |
| flags | additional flags for the auto-obsoletion mechanism |
Implements eq::net::ObjectCM.
Definition at line 58 of file fullMasterCM.h.
References _nVersions, and _obsoleteFlags.
| virtual uint32_t eq::net::FullMasterCM::getAutoObsoleteCount | ( | ) | const [inline, virtual] |
Implements eq::net::ObjectCM.
Definition at line 62 of file fullMasterCM.h.
References _nVersions.
| virtual uint32_t eq::net::FullMasterCM::sync | ( | const uint32_t | version | ) | [inline, virtual] |
Sync to a given version.
| version | the version to synchronize, must be bigger than the current version. |
Implements eq::net::ObjectCM.
Definition at line 64 of file fullMasterCM.h.
References _version.
| virtual uint32_t eq::net::FullMasterCM::getHeadVersion | ( | ) | const [inline, virtual] |
Implements eq::net::ObjectCM.
Definition at line 67 of file fullMasterCM.h.
References _version.
| virtual uint32_t eq::net::FullMasterCM::getVersion | ( | ) | const [inline, virtual] |
Implements eq::net::ObjectCM.
Definition at line 68 of file fullMasterCM.h.
References _version.
| uint32_t eq::net::FullMasterCM::getOldestVersion | ( | ) | const [virtual] |
Implements eq::net::ObjectCM.
Definition at line 124 of file fullMasterCM.cpp.
References _instanceDatas, and _version.
Referenced by addSlave().

| virtual bool eq::net::FullMasterCM::isMaster | ( | ) | const [inline, virtual] |
Implements eq::net::ObjectCM.
Definition at line 72 of file fullMasterCM.h.
| virtual uint32_t eq::net::FullMasterCM::getMasterInstanceID | ( | ) | const [inline, virtual] |
Implements eq::net::ObjectCM.
Definition at line 73 of file fullMasterCM.h.
| uint32_t eq::net::FullMasterCM::addSlave | ( | Command & | command | ) | [virtual] |
Add a subscribed slave to the managed object.
| command | the subscribe command initiating the add. |
Implements eq::net::ObjectCM.
Definition at line 132 of file fullMasterCM.cpp.
References _instanceDatas, _object, _slaves, _slavesCount, _version, EQ_MAX, EQINFO, EQLOG, eq::net::Object::getInstanceID(), getOldestVersion(), eq::net::DataOStream::resend(), and std::usort().

| void eq::net::FullMasterCM::removeSlave | ( | NodePtr | node | ) | [virtual] |
Remove a subscribed slave.
| node | the slave node. |
Implements eq::net::ObjectCM.
Definition at line 224 of file fullMasterCM.cpp.
References _slaves, and _slavesCount.
| virtual const NodeVector* eq::net::FullMasterCM::getSlaveNodes | ( | ) | const [inline, virtual] |
Reimplemented from eq::net::ObjectCM.
Definition at line 77 of file fullMasterCM.h.
References _slaves.
| void eq::net::FullMasterCM::addOldMaster | ( | NodePtr | node, | |
| const uint32_t | instanceID | |||
| ) | [virtual] |
Add the old master as a slave.
Implements eq::net::ObjectCM.
Definition at line 243 of file fullMasterCM.cpp.
References _object, _slaves, _slavesCount, _version, eq::net::Object::send(), and std::usort().

| virtual void eq::net::FullMasterCM::applyMapData | ( | ) | [inline, virtual] |
Apply the initial data after mapping.
Implements eq::net::ObjectCM.
Definition at line 80 of file fullMasterCM.h.
Object* eq::net::FullMasterCM::_object [protected] |
The managed object.
Definition at line 84 of file fullMasterCM.h.
Referenced by addOldMaster(), addSlave(), and commitNB().
NodeVector eq::net::FullMasterCM::_slaves [protected] |
The list of subsribed slave nodes.
Definition at line 87 of file fullMasterCM.h.
Referenced by addOldMaster(), addSlave(), getSlaveNodes(), and removeSlave().
base::UUIDHash< uint32_t > eq::net::FullMasterCM::_slavesCount [protected] |
The number of object instances subscribed per slave node.
Definition at line 90 of file fullMasterCM.h.
Referenced by addOldMaster(), addSlave(), and removeSlave().
uint32_t eq::net::FullMasterCM::_version [protected] |
The current version.
Definition at line 93 of file fullMasterCM.h.
Referenced by addOldMaster(), addSlave(), getHeadVersion(), getOldestVersion(), getVersion(), and sync().
uint32_t eq::net::FullMasterCM::_commitCount [protected] |
The number of commits, needed for auto-obsoletion.
Definition at line 96 of file fullMasterCM.h.
uint32_t eq::net::FullMasterCM::_nVersions [protected] |
The number of old versions to retain.
Definition at line 99 of file fullMasterCM.h.
Referenced by getAutoObsoleteCount(), and setAutoObsolete().
uint32_t eq::net::FullMasterCM::_obsoleteFlags [protected] |
The flags for automatic version obsoletion.
Definition at line 102 of file fullMasterCM.h.
Referenced by setAutoObsolete().
Registers request packets waiting for a return value.
Definition at line 105 of file fullMasterCM.h.
Referenced by commitNB(), and commitSync().
InstanceDataDeque eq::net::FullMasterCM::_instanceDatas [protected] |
The list of full instance datas, head version last.
Definition at line 120 of file fullMasterCM.h.
Referenced by addSlave(), and getOldestVersion().
0.9.1 by
1.6.1