Equalizer
1.2.1
|
Base data transport class for nodes. More...
#include <node.h>
Classes | |
struct | BackupData |
Public Member Functions | |
Data Access | |
C * | getConfig () |
const C * | getConfig () const |
const Pipes & | getPipes () const |
bool | isApplicationNode () const |
EQFABRIC_INL void | setApplicationNode (const bool isAppNode) |
EQFABRIC_INL NodePath | getPath () const |
P * | findPipe (const co::base::UUID &id) |
EQFABRIC_INL VisitorResult | accept (V &visitor) |
Traverse this node and all children using a node visitor. | |
EQFABRIC_INL VisitorResult | accept (V &visitor) const |
Const-version of accept(). | |
virtual EQFABRIC_INL void | backup () |
virtual EQFABRIC_INL void | restore () |
void | create (P **pipe) |
void | release (P *pipe) |
virtual void | output (std::ostream &) const |
virtual EQFABRIC_INL uint128_t | commit (const uint32_t incarnation=CO_COMMIT_NEXT) |
Commit a new version of this object. | |
Public Types | |
typedef std::vector< P * > | Pipes |
A vector of pointers to pipes. | |
Protected Member Functions | |
Node (C *parent) | |
virtual EQFABRIC_INL void | serialize (co::DataOStream &os, const uint64_t dirtyBits) |
Worker for pack() and getInstanceData(). | |
virtual EQFABRIC_INL void | deserialize (co::DataIStream &is, const uint64_t dirtyBits) |
Worker for unpack() and applyInstanceData(). | |
virtual EQFABRIC_INL void | notifyDetach () |
Notify that this object will be deregistered or unmapped. | |
virtual EQFABRIC_INL void | setDirty (const uint64_t bits) |
virtual ChangeType | getChangeType () const |
virtual uint64_t | getRedistributableBits () const |
Protected Types | |
enum | DirtyBits { DIRTY_ATTRIBUTES = Object::DIRTY_CUSTOM << 0, DIRTY_PIPES = Object::DIRTY_CUSTOM << 1, DIRTY_MEMBER = Object::DIRTY_CUSTOM << 2, DIRTY_NODE_BITS } |
The changed parts of the object since the last pack(). More... | |
Friends | |
class | Pipe |
Attributes | |
enum | IAttribute { IATTR_THREAD_MODEL, IATTR_LAUNCH_TIMEOUT, IATTR_LAST, IATTR_ALL = IATTR_LAST + 5 } |
Integer attributes. More... | |
EQFABRIC_INL void | setIAttribute (const IAttribute attr, const int32_t value) |
EQFABRIC_INL int32_t | getIAttribute (const IAttribute attr) const |
static const std::string & | getIAttributeString (const IAttribute attr) |
Base data transport class for nodes.
Definition at line 31 of file include/eq/fabric/node.h.
typedef std::vector< P* > eq::fabric::Node< C, N, P, V >::Pipes |
enum eq::fabric::Node::DirtyBits [protected] |
The changed parts of the object since the last pack().
Subclasses should define their own bits, starting at DIRTY_CUSTOM.
Reimplemented from eq::fabric::Object.
Definition at line 131 of file include/eq/fabric/node.h.
enum eq::fabric::Node::IAttribute |
Integer attributes.
Definition at line 79 of file include/eq/fabric/node.h.
EQFABRIC_INL VisitorResult eq::fabric::Node< C, N, P, V >::accept | ( | V & | visitor | ) |
Traverse this node and all children using a node visitor.
visitor | the visitor. |
EQFABRIC_INL VisitorResult eq::fabric::Node< C, N, P, V >::accept | ( | V & | visitor | ) | const |
Const-version of accept().
virtual EQFABRIC_INL uint128_t eq::fabric::Node< C, N, P, V >::commit | ( | const uint32_t | incarnation = CO_COMMIT_NEXT | ) | [virtual] |
Commit a new version of this object.
Objects using the change type STATIC can not be committed.
Master instances will increment new versions continously, starting at VERSION_FIRST. If the object has not changed, no new version will be generated, that is, the current version is returned. The high value of the returned version will always be 0.
Slave objects can be commited, but have certain caveats for serialization. Please refer to the Programming Guide for more details. Slave object commits will return a random version on a successful commit, or VERSION_NONE if the object has not changed since the last commit. The high value of a successful commit will never be 0.
The incarnation count is meaningful for buffered master objects. The commit implementation will keep all instance data committed with an incarnation count newer than current_incarnation - getAutoObsolete()
. By default, each call to commit creates a new incarnation, retaining the data from last getAutoObsolete() commit calls. When the application wishes to auto obsolete by another metric than commit calls, it has to consistently provide an incarnation counter. Buffers with a higher incarnation count than the current are discarded. A typical use case is to tie the auto obsoletion to an application-specific frame loop. Decreasing the incarnation counter will lead to undefined results.
incarnation | the commit incarnation for auto obsoletion. |
Reimplemented from eq::fabric::Object.
virtual EQFABRIC_INL void eq::fabric::Node< C, N, P, V >::deserialize | ( | co::DataIStream & | , |
const uint64_t | |||
) | [protected, virtual] |
Worker for unpack() and applyInstanceData().
This function is called with the dirty bits send by the master instance. The dirty bits are received beforehand, and do not need to be deserialized by the overriding method.
Reimplemented from eq::fabric::Object.
virtual ChangeType eq::fabric::Node< C, N, P, V >::getChangeType | ( | ) | const [inline, protected, virtual] |
Reimplemented from co::Serializable.
Definition at line 129 of file include/eq/fabric/node.h.
C* eq::fabric::Node< C, N, P, V >::getConfig | ( | ) | [inline] |
Definition at line 40 of file include/eq/fabric/node.h.
const C* eq::fabric::Node< C, N, P, V >::getConfig | ( | ) | const [inline] |
Definition at line 43 of file include/eq/fabric/node.h.
EQFABRIC_INL int32_t eq::fabric::Node< C, N, P, V >::getIAttribute | ( | const IAttribute | attr | ) | const |
const Pipes& eq::fabric::Node< C, N, P, V >::getPipes | ( | ) | const [inline] |
Definition at line 46 of file include/eq/fabric/node.h.
virtual EQFABRIC_INL void eq::fabric::Node< C, N, P, V >::notifyDetach | ( | ) | [protected, virtual] |
Notify that this object will be deregistered or unmapped.
The method is called from the thread initiating the deregistration or unmapping, before the operation is executed.
Reimplemented from eq::fabric::Object.
virtual EQFABRIC_INL void eq::fabric::Node< C, N, P, V >::serialize | ( | co::DataOStream & | , |
const uint64_t | |||
) | [protected, virtual] |
Worker for pack() and getInstanceData().
Override this and deserialize() if you want to distribute subclassed data.
This method is called with DIRTY_ALL from getInstanceData() and with the actual dirty bits from pack(), which also resets the dirty state afterwards. The dirty bits are transmitted beforehand, and do not need to be transmitted by the overriding method.
Reimplemented from eq::fabric::Object.
virtual EQFABRIC_INL void eq::fabric::Node< C, N, P, V >::setDirty | ( | const uint64_t | bits | ) | [protected, virtual] |