Equalizer  1.13.0
Parallel Rendering Framework
eq::Node Class Reference

A Node represents a single computer in the cluster. More...

#include <node.h>

+ Inheritance diagram for eq::Node:
+ Collaboration diagram for eq::Node:

Public Member Functions

EQ_API Node (Config *parent)
 Construct a new node. More...
 
virtual EQ_API ~Node ()
 Destruct the node. More...
 
EQ_API ClientPtr getClient ()
 
EQ_API ServerPtr getServer ()
 
EQ_API co::CommandQueue * getMainThreadQueue ()
 
EQ_API co::CommandQueue * getCommandThreadQueue ()
 
co::CommandQueue * getTransmitterQueue ()
 
uint32_t getCurrentFrame () const
 
co::Barrier * getBarrier (const co::ObjectVersion &barrier)
 
FrameDataPtr getFrameData (const co::ObjectVersion &frameDataVersion)
 
void releaseFrameData (FrameDataPtr data)
 
EQ_API void waitInitialized () const
 
EQ_API bool isRunning () const
 
EQ_API bool isStopped () const
 
EQ_API void waitFrameStarted (const uint32_t frameNumber) const
 Wait for a frame to be started. More...
 
uint32_t getFinishedFrame () const
 
EQ_API EventOCommand sendError (const uint32_t error)
 Send an error event to the application node. More...
 
virtual EQ_API bool processEvent (const Event &event)
 Process a received event. More...
 
virtual EQ_API void setDirty (const uint64_t bits)
 
EQ_API void dirtyClientExit ()
 
- Public Member Functions inherited from eq::fabric::Node< Config, Node, Pipe, NodeVisitor >
ConfiggetConfig ()
 
const ConfiggetConfig () const
 
const PipesgetPipes () const
 
bool isApplicationNode () const
 
EQFABRIC_INL void setApplicationNode (const bool isAppNode)
 
EQFABRIC_INL NodePath getPath () const
 
PipefindPipe (const uint128_t &id)
 
EQFABRIC_INL VisitorResult accept (NodeVisitor &visitor)
 Perform a depth-first traversal of this node. More...
 
EQFABRIC_INL VisitorResult accept (NodeVisitor &visitor) const
 Const-version of accept(). More...
 
virtual EQFABRIC_INL void backup ()
 
virtual EQFABRIC_INL void restore ()
 
void create (Pipe **pipe)
 
void release (Pipe *pipe)
 
virtual void output (std::ostream &) const
 
virtual EQFABRIC_INL uint128_t commit (const uint32_t incarnation=CO_COMMIT_NEXT)
 
EQFABRIC_INL void setIAttribute (const IAttribute attr, const int32_t value)
 
EQFABRIC_INL int32_t getIAttribute (const IAttribute attr) const
 
- Public Member Functions inherited from eq::fabric::Object
virtual EQFABRIC_API bool isDirty () const
 
virtual EQFABRIC_API void setName (const std::string &name)
 Set the name of the object. More...
 
EQFABRIC_API const std::string & getName () const
 
EQFABRIC_API void setUserData (co::Object *userData)
 Set user-specific data. More...
 
EQFABRIC_API co::Object * getUserData ()
 
EQFABRIC_API const co::Object * getUserData () const
 
EQFABRIC_API uint32_t getTasks () const
 Return the set of tasks this channel might execute in the worst case. More...
 
EQFABRIC_API uint32_t getSerial () const
 

Protected Member Functions

virtual EQ_API void attach (const uint128_t &id, const uint32_t instanceID)
 
Actions
EQ_API void startFrame (const uint32_t frameNumber)
 Start a frame by unlocking all child resources. More...
 
EQ_API void releaseFrame (const uint32_t frameNumber)
 Signal the completion of a frame to the parent. More...
 
EQ_API void releaseFrameLocal (const uint32_t frameNumber)
 Release the local synchronization of the parent for a frame. More...
 
Callbacks

The callbacks are called by Equalizer during rendering to execute various actions.

virtual EQ_API bool configInit (const uint128_t &initID)
 Initialize this node. More...
 
virtual EQ_API bool configExit ()
 Exit this node. More...
 
virtual EQ_API void frameStart (const uint128_t &frameID, const uint32_t frameNumber)
 Start rendering a frame. More...
 
virtual EQ_API void frameFinish (const uint128_t &frameID, const uint32_t frameNumber)
 Finish rendering a frame. More...
 
virtual EQ_API void frameDrawFinish (const uint128_t &frameID, const uint32_t frameNumber)
 Finish drawing. More...
 
virtual EQ_API void frameTasksFinish (const uint128_t &frameID, const uint32_t frameNumber)
 Finish all rendering tasks. More...
 
- Protected Member Functions inherited from eq::fabric::Node< Config, Node, Pipe, NodeVisitor >
 Node (Config *parent)
 
virtual EQFABRIC_INL void serialize (co::DataOStream &os, const uint64_t dirtyBits)
 
virtual EQFABRIC_INL void deserialize (co::DataIStream &is, const uint64_t dirtyBits)
 
virtual EQFABRIC_INL void notifyDetach ()
 
virtual ChangeType getChangeType () const
 
virtual uint64_t getRedistributableBits () const
 
- Protected Member Functions inherited from eq::fabric::Object
EQFABRIC_API Object ()
 Construct a new Object. More...
 
EQFABRIC_API Object (const Object &)
 Construct an unmapped, unregistered copy of an object. More...
 
virtual EQFABRIC_API ~Object ()
 Destruct the object. More...
 
EQFABRIC_API Objectoperator= (const Object &from)
 NOP assignment operator. More...
 
virtual bool hasMasterUserData ()
 
virtual uint32_t getUserDataLatency () const
 
EQFABRIC_API void setTasks (const uint32_t tasks)
 
EQFABRIC_API void postRemove (Object *child)
 
virtual void removeChild (const uint128_t &)
 
template<class C , class S >
void commitChild (C *child, S *sender, uint32_t cmd, const uint32_t incarnation)
 
template<class C >
void commitChild (C *child, const uint32_t incarnation)
 
template<class C , class S >
void commitChildren (const std::vector< C * > &children, S *sender, uint32_t cmd, const uint32_t incarnation)
 
template<class C >
void commitChildren (const std::vector< C * > &children, uint32_t cmd, const uint32_t incarnation)
 
template<class C >
void commitChildren (const std::vector< C * > &children, const uint32_t incarnation)
 
template<class C >
void syncChildren (const std::vector< C * > &children)
 
template<class P , class C >
void releaseChildren (const std::vector< C * > &children)
 
EQFABRIC_API bool _cmdSync (co::ICommand &command)
 

Additional Inherited Members

- Public Types inherited from eq::fabric::Node< Config, Node, Pipe, NodeVisitor >
typedef std::vector< Pipe * > Pipes
 A vector of pointers to pipes. More...
 
enum  IAttribute
 Integer attributes. More...
 
- Public Types inherited from eq::fabric::Object
enum  DirtyBits {
  DIRTY_NAME = Serializable::DIRTY_CUSTOM << 0, DIRTY_USERDATA = Serializable::DIRTY_CUSTOM << 1, DIRTY_TASKS = Serializable::DIRTY_CUSTOM << 2, DIRTY_REMOVED = Serializable::DIRTY_CUSTOM << 3,
  DIRTY_SERIAL = Serializable::DIRTY_CUSTOM << 4, DIRTY_CUSTOM = Serializable::DIRTY_CUSTOM << 6, DIRTY_OBJECT_BITS = DIRTY_NAME | DIRTY_USERDATA
}
 The changed parts of the object since the last pack(). More...
 
- Static Public Member Functions inherited from eq::fabric::Node< Config, Node, Pipe, NodeVisitor >
static const std::string & getIAttributeString (const IAttribute attr)
 
- Protected Types inherited from eq::fabric::Node< Config, Node, Pipe, NodeVisitor >
enum  DirtyBits
 

Detailed Description

A Node represents a single computer in the cluster.

Each node is executed in a separate process. Each process has only its local node instantiated, that is, it has at most instance of a Node and does not see other node instances. The application process may not have a node, which is the case when it does not contribute to the rendering.

The eq::Node is not to be confused with the co::Node which represents the process in the underlying peer-to-peer network layer. The eq::Client and eq::Server are co::Nodes representing the local client and Equalizer server, respectively.

See also
fabric::Node

Definition at line 48 of file node.h.

Constructor & Destructor Documentation

EQ_API eq::Node::Node ( Config parent)
explicit

Construct a new node.

Version
1.0
virtual EQ_API eq::Node::~Node ( )
virtual

Destruct the node.

Version
1.0

Reimplemented from eq::fabric::Node< Config, Node, Pipe, NodeVisitor >.

Member Function Documentation

virtual EQ_API bool eq::Node::configExit ( )
protectedvirtual

Exit this node.

Version
1.0
virtual EQ_API bool eq::Node::configInit ( const uint128_t &  initID)
protectedvirtual

Initialize this node.

Parameters
initIDthe init identifier.
Version
1.0
virtual EQ_API void eq::Node::frameDrawFinish ( const uint128_t &  frameID,
const uint32_t  frameNumber 
)
protectedvirtual

Finish drawing.

Called once per frame after the last draw operation. Waits for the pipes to release the local synchonization and releases the node's local synchronization if the thread model is draw_sync (the default).

Parameters
frameIDthe per-frame identifier.
frameNumberthe frame finished with draw.
See also
Pipe::waitFrameLocal(), releaseFrameLocal()
Version
1.0
virtual EQ_API void eq::Node::frameFinish ( const uint128_t &  frameID,
const uint32_t  frameNumber 
)
protectedvirtual

Finish rendering a frame.

Called once at the end of each frame, to end the frame and to do per-frame updates of node-specific data. This method has to call releaseFrame().

Parameters
frameIDthe per-frame identifier.
frameNumberthe frame to finish.
See also
endFrame(), Config::finishFrame()
Version
1.0
virtual EQ_API void eq::Node::frameStart ( const uint128_t &  frameID,
const uint32_t  frameNumber 
)
protectedvirtual

Start rendering a frame.

Called once at the beginning of each frame, to start the node's frame and to do per-frame updates of node-specific data. This method has to call startFrame(). Immediately releases local synchronization if the thread model is async.

Parameters
frameIDthe per-frame identifier.
frameNumberthe frame to start.
See also
startFrame(), Config::beginFrame()
Version
1.0
virtual EQ_API void eq::Node::frameTasksFinish ( const uint128_t &  frameID,
const uint32_t  frameNumber 
)
protectedvirtual

Finish all rendering tasks.

Called once per frame after all frame tasks. Waits for the pipes to release the local synchonization and releases the node's local synchronization if the thread model is local_sync.

Note that frameFinish is called after the latency is exhausted and synchronizes pipe thread execution.

Parameters
frameIDthe per-frame identifier.
frameNumberthe frame finished with draw.
See also
Pipe::waitFrameLocal(), releaseFrameLocal()
Version
1.0
EQ_API ClientPtr eq::Node::getClient ( )
Returns
the parent client node.
Version
1.0
EQ_API ServerPtr eq::Node::getServer ( )
Returns
the parent server node.
Version
1.0
EQ_API bool eq::Node::isRunning ( ) const
Returns
true if this node is running, false otherwise.
Version
1.0
EQ_API bool eq::Node::isStopped ( ) const
Returns
true if this node is stopped, false otherwise.
Version
1.0
virtual EQ_API bool eq::Node::processEvent ( const Event &  event)
virtual

Process a received event.

The task of this method is to update the node as necessary, and transform the event into a config event to be send to the application using Config::sendEvent().

Parameters
eventthe received event.
Returns
true when the event was handled, false if not.
Version
1.5.2
EQ_API void eq::Node::releaseFrame ( const uint32_t  frameNumber)
protected

Signal the completion of a frame to the parent.

Parameters
frameNumberthe frame to end.
Version
1.0
EQ_API void eq::Node::releaseFrameLocal ( const uint32_t  frameNumber)
protected

Release the local synchronization of the parent for a frame.

Parameters
frameNumberthe frame to release.
Version
1.0
EQ_API EventOCommand eq::Node::sendError ( const uint32_t  error)

Send an error event to the application node.

Parameters
errorthe error code.
Version
1.7.1
virtual EQ_API void eq::Node::setDirty ( const uint64_t  bits)
virtual
See also
Serializable::setDirty()

Reimplemented from eq::fabric::Node< Config, Node, Pipe, NodeVisitor >.

EQ_API void eq::Node::startFrame ( const uint32_t  frameNumber)
protected

Start a frame by unlocking all child resources.

Parameters
frameNumberthe frame to start.
Version
1.0
EQ_API void eq::Node::waitFrameStarted ( const uint32_t  frameNumber) const

Wait for a frame to be started.

Used by the pipe task methods to implement the current thread synchronization model.

Parameters
frameNumberthe frame number.
See also
releaseFrame()
Version
1.0

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