Equalizer 1.0

eq::Config Class Reference

A configuration is a visualization session driven by an application. More...

#include <config.h>

Inheritance diagram for eq::Config:
Collaboration diagram for eq::Config:

List of all members.

Classes

class  LatencyObject

Public Member Functions

 Config (ServerPtr parent)
 Construct a new config.
virtual ~Config ()
 Destruct a config.
void setupMessagePump (Pipe *pipe)
void setupServerConnections (const char *connectionData)
Data Access
ClientPtr getClient ()
ConstClientPtr getClient () const
co::NodePtr getApplicationNode ()
co::CommandQueuegetMainThreadQueue ()
co::CommandQueuegetCommandThreadQueue ()
uint32_t getCurrentFrame () const
uint32_t getFinishedFrame () const
void getStatistics (std::vector< FrameStatistics > &stats)
bool isRunning () const
void stopRunning ()
 Stop the config.
int64_t getTime () const
 Get the current time in milliseconds.
MessagePumpgetMessagePump ()
const ChannelfindChannel (const std::string &name) const
Operations
virtual bool init (const uint128_t &initID)
 Initialize this configuration.
virtual bool exit ()
 Exit this configuration.
bool update ()
 Update the configuration.
void freezeLoadBalancing (const bool onOff)
virtual void setLatency (const uint32_t latency)
Object registry.
virtual bool registerObject (co::Object *object)
 Register a distributed object.
virtual void deregisterObject (co::Object *object)
 Deregister a distributed object.
virtual bool mapObject (co::Object *object, const UUID &id, const uint128_t &version=co::VERSION_OLDEST)
 Map a distributed object.
virtual uint32_t mapObjectNB (co::Object *object, const UUID &id, const uint128_t &version=co::VERSION_OLDEST)
 Start mapping a distributed object.
virtual uint32_t mapObjectNB (co::Object *object, const UUID &id, const uint128_t &version, co::NodePtr master)
 Start mapping a distributed object from a known master.
virtual bool mapObjectSync (const uint32_t requestID)
 Finalize the mapping of a distributed object.
virtual void unmapObject (co::Object *object)
 Unmap a mapped object.
void releaseObject (co::Object *object)
 Convenience method to deregister or unmap an object.
Frame Control
virtual uint32_t startFrame (const uint128_t &frameID)
 Request a new frame of rendering.
virtual uint32_t finishFrame ()
 Finish the rendering of a frame.
virtual uint32_t finishAllFrames ()
 Finish rendering all pending frames.
void releaseFrameLocal (const uint32_t frameNumber)
 Release the local synchronization of the config for a frame.
void stopFrames ()
 Asynchronously signal all channels to interrupt their rendering.
Event handling
void sendEvent (ConfigEvent &event)
 Send an event to the application node.
const ConfigEventnextEvent ()
 Get the next event.
const ConfigEventtryNextEvent ()
 Try to get the next event.
bool checkEvent () const
virtual void handleEvents ()
 Handle all config events.
virtual bool handleEvent (const ConfigEvent *event)
 Handle one config event.

Public Types

typedef fabric::Config< Server,
Config, Observer, Layout,
Canvas, Node, ConfigVisitor
Super
 base class

Protected Member Functions

virtual void attach (const co::base::UUID &id, const uint32_t instanceID)
virtual void notifyAttached ()
 Notify that this object has been registered or mapped.
virtual void notifyDetach ()
 Notify that this object will be deregistered or unmapped.
virtual void changeLatency (const uint32_t latency)
virtual bool mapViewObjects () const

Friends

class Node

Detailed Description

A configuration is a visualization session driven by an application.

The application Client can choose a configuration from a Server. The Config will be instantiated though the NodeFactory. The Config groups all processes of the application in a single session.

A configuration has a number of nodes, which represent the processes involved in it. While the Server drives all nodes, a Config instance in a given process only has its Node instantiated, that is, any given Config has at most one Node.

The Config in the application process has access to all Canvas, Segment, Layout, View and Observer instances. Only the active Layout of the each Canvas, the Frustum of each View and the Observer parameters are writable. Views can be sub-classed to attach application-specific data.

The render client processes have only access to the current View for each of their channels.

See also:
fabric::Config for public methods

Definition at line 54 of file include/eq/config.h.


Constructor & Destructor Documentation

eq::Config::Config ( ServerPtr  parent)

Construct a new config.

Version:
1.0

Reimplemented in eqNbody::Config, and osgScaleViewer::Config.

virtual eq::Config::~Config ( ) [virtual]

Member Function Documentation

bool eq::Config::checkEvent ( ) const [inline]
Returns:
true if events are pending.
Version:
1.0

Definition at line 373 of file include/eq/config.h.

References co::CommandQueue::isEmpty().

Here is the call graph for this function:

virtual void eq::Config::deregisterObject ( co::Object object) [virtual]

Deregister a distributed object.

This method ensures that the data for buffered object is kept for latency frames to allow mapping on slave nodes.

Parameters:
objectthe object instance.
Version:
1.0

Referenced by osgScaleViewer::Config::exit().

Here is the caller graph for this function:

virtual bool eq::Config::exit ( ) [virtual]

Exit this configuration.

This method is to be called only on the application node on an initialized configuration.

Exiting a configuration calls configExit on all active render entities, releases the entities using the NodeFactory and stops the render clients.

A configuration which was not exited properly may not be re-initialized.

Returns:
true if the exit was successful, false if not.
Version:
1.0

Reimplemented in eqNbody::Config, eqPly::Config, eVolve::Config, and osgScaleViewer::Config.

Referenced by eqPly::Config::exit().

Here is the caller graph for this function:

virtual uint32_t eq::Config::finishAllFrames ( ) [virtual]

Finish rendering all pending frames.

This method is to be called only on the application node on an initialized configuration.

Returns:
the frame number of the last finished frame.
Version:
1.0

Referenced by osgScaleViewer::OSGScaleViewer::run(), eVolve::EVolve::run(), and eqPly::EqPly::run().

Here is the caller graph for this function:

virtual uint32_t eq::Config::finishFrame ( ) [virtual]

Finish the rendering of a frame.

This method is to be called only on the application node on an initialized configuration.

This method synchronizes the local and global rendering. The global rendering is always synchronized to finish the frame (current - latency). The local rendering is synchronized according to the current thread model (cf. Node::IATTR_THREAD_MODEL)

Returns:
the frame number of the globally finished frame, or 0 if no frame has been finished yet.
Version:
1.0

Referenced by osgScaleViewer::OSGScaleViewer::run(), eVolve::EVolve::run(), and eqPly::EqPly::run().

Here is the caller graph for this function:

void eq::Config::freezeLoadBalancing ( const bool  onOff)
Warning:
Experimental - may not be supported in the future
co::NodePtr eq::Config::getApplicationNode ( ) [inline]
Returns:
the application node.
Warning:
experimental, may not be supported in the future

Definition at line 79 of file include/eq/config.h.

Referenced by eqPly::Config::mapData().

Here is the caller graph for this function:

ConstClientPtr eq::Config::getClient ( ) const
Returns:
the local client node.
Version:
1.0
ClientPtr eq::Config::getClient ( )
Returns:
the local client node.
Version:
1.0

Referenced by eqPly::Config::getModel().

Here is the caller graph for this function:

uint32_t eq::Config::getCurrentFrame ( ) const [inline]
Returns:
the frame number of the last frame started.
Version:
1.0

Definition at line 85 of file include/eq/config.h.

uint32_t eq::Config::getFinishedFrame ( ) const [inline]
Returns:
the frame number of the last frame finished.
Version:
1.0

Definition at line 88 of file include/eq/config.h.

References co::base::Monitor< T >::get().

Here is the call graph for this function:

MessagePump* eq::Config::getMessagePump ( )
Returns:
the config's message pump, or 0.
Version:
1.0
int64_t eq::Config::getTime ( ) const [inline]

Get the current time in milliseconds.

The clock in all processes of the config is synchronized to the Server clock. The precision of this synchronization is typically about 1 ms. The clock of the last instantiated config is used as the co::base::Log clock.

Returns:
the global time in ms.
Version:
1.0

Definition at line 114 of file include/eq/config.h.

References co::base::Clock::getTime64().

Referenced by osgScaleViewer::Node::frameStart(), and eqPly::Config::isUserEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool eq::Config::handleEvent ( const ConfigEvent event) [virtual]

Handle one config event.

Parameters:
eventthe event.
Returns:
true if the event requires a redraw, false if not.
Version:
1.0

Reimplemented in eqNbody::Config, eqPixelBench::Config, eqPly::Config, eVolve::Config, and osgScaleViewer::Config.

virtual void eq::Config::handleEvents ( ) [virtual]

Handle all config events.

To be called only on the application node.

Called automatically at the end of each frame to handle pending config events. The default implementation calls handleEvent() on all pending events, without blocking.

Version:
1.0

Referenced by eqPly::EqPly::run().

Here is the caller graph for this function:

virtual bool eq::Config::init ( const uint128_t initID) [virtual]

Initialize this configuration.

This method is to be called only on the application node on an uninitialized configuration.

Initializing a configuration starts and connects all render clients, instantiates all active render entities (Node, Pipe, Window, Channel) using the NodeFactory of each process, and calls the configInit task methods on each of these entities, passing the given identifier.

The identifier is typically the identifier of a static Object containing initialization data.

The initialization fails if at least one of the configInit task methods fails. The application can use setErrorMessage on the render client to pass an error string to the application process, which it can query it using getError().

Parameters:
initIDan identifier to be passed to all init methods.
Returns:
true if the initialization was successful, false if not.
Version:
1.0

Referenced by eVolve::Config::init(), and eqPly::Config::init().

Here is the caller graph for this function:

bool eq::Config::isRunning ( ) const [inline]
Returns:
true while the config is initialized and no exit event has happened.
Version:
1.0

Definition at line 98 of file include/eq/config.h.

Referenced by osgScaleViewer::OSGScaleViewer::run(), eVolve::EVolve::run(), and eqPly::EqPly::run().

Here is the caller graph for this function:

virtual bool eq::Config::mapObject ( co::Object object,
const UUID id,
const uint128_t version = co::VERSION_OLDEST 
) [virtual]

Map a distributed object.

Provided for symmetry with deregisterObject. Forwards mapping to local client node.

Version:
1.0

Referenced by osgScaleViewer::Pipe::configInit(), eVolve::Pipe::configInit(), eqPly::Pipe::configInit(), eqNbody::Pipe::configInit(), and eVolve::Config::mapData().

Here is the caller graph for this function:

virtual uint32_t eq::Config::mapObjectNB ( co::Object object,
const UUID id,
const uint128_t version,
co::NodePtr  master 
) [virtual]

Start mapping a distributed object from a known master.

Version:
1.0
virtual uint32_t eq::Config::mapObjectNB ( co::Object object,
const UUID id,
const uint128_t version = co::VERSION_OLDEST 
) [virtual]

Start mapping a distributed object.

Version:
1.0

Referenced by eqPly::Config::mapData().

Here is the caller graph for this function:

virtual bool eq::Config::mapObjectSync ( const uint32_t  requestID) [virtual]

Finalize the mapping of a distributed object.

Version:
1.0

Referenced by eqPly::Config::mapData().

Here is the caller graph for this function:

const ConfigEvent* eq::Config::nextEvent ( )

Get the next event.

To be called only on the application node.

The returned event is valid until the next call to this method. This method may block.

Returns:
the event.
Version:
1.0
See also:
Client::processCommand()

Referenced by eqPly::EqPly::run().

Here is the caller graph for this function:

virtual void eq::Config::notifyAttached ( ) [protected, virtual]

Notify that this object has been registered or mapped.

The method is called from the thread initiating the registration or mapping, after the operation has been completed successfully.

See also:
isMaster()

Reimplemented from eq::fabric::Serializable.

virtual void eq::Config::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.

See also:
isMaster()

Reimplemented from eq::fabric::Config< Server, Config, Observer, Layout, Canvas, Node, ConfigVisitor >.

virtual bool eq::Config::registerObject ( co::Object object) [virtual]

Register a distributed object.

Provided for symmetry with deregisterObject. Forwards registration to local client node.

Version:
1.0

Referenced by osgScaleViewer::Config::init(), eVolve::Config::init(), and eqPly::Config::init().

Here is the caller graph for this function:

void eq::Config::releaseFrameLocal ( const uint32_t  frameNumber) [inline]

Release the local synchronization of the config for a frame.

Used by the local Node to release the process-local frame synchronization. An application typically does not call this method directly, it is called from Node::releaseFrameLocal(), which in turn is called from the appropriate task method depending on the thread model.

Parameters:
frameNumberthe frame to release.
Version:
1.0

Definition at line 319 of file include/eq/config.h.

void eq::Config::releaseObject ( co::Object object)

Convenience method to deregister or unmap an object.

Version:
1.0
void eq::Config::sendEvent ( ConfigEvent event)

Send an event to the application node.

Parameters:
eventthe event.
Version:
1.0

Referenced by eqPixelBench::Channel::frameStart(), and eqPly::Channel::frameViewFinish().

Here is the caller graph for this function:

virtual void eq::Config::setLatency ( const uint32_t  latency) [virtual]
virtual uint32_t eq::Config::startFrame ( const uint128_t frameID) [virtual]

Request a new frame of rendering.

This method is to be called only on the application node on an initialized configuration. It implicitely calls update().

The server will sync to the new data, and generate all render tasks, which are queued on the render clients for execution.

Each call to startFrame() has to be completed by a finishFrame() or finishAllFrames() before the next call to startFrame().

Parameters:
frameIDa per-frame identifier passed to all rendering methods.
Returns:
the frame number of the new frame.
Version:
1.0

Reimplemented in eqPixelBench::Config.

Referenced by eqPixelBench::Config::startFrame().

Here is the caller graph for this function:

void eq::Config::stopFrames ( )

Asynchronously signal all channels to interrupt their rendering.

This method may be called from any thread in the application process. It causes Channel::notifyStopFrame() to be called immediately on all active channels.

Version:
1.0
void eq::Config::stopRunning ( ) [inline]

Stop the config.

Version:
1.0

Definition at line 101 of file include/eq/config.h.

const ConfigEvent* eq::Config::tryNextEvent ( )

Try to get the next event.

To be called only on the application node.

The returned event is valid until the next call to this method. This method does not block.

Returns:
a config event, or 0 if no events are pending.
Version:
1.0
virtual void eq::Config::unmapObject ( co::Object object) [virtual]

Unmap a mapped object.

Provided for symmetry with deregisterObject. Forwards unmapping to local client node.

Version:
1.0

Referenced by osgScaleViewer::Pipe::configExit(), eVolve::Pipe::configExit(), eqPly::Pipe::configExit(), eqNbody::Pipe::configExit(), eVolve::Config::mapData(), and eqPly::Config::mapData().

Here is the caller graph for this function:

bool eq::Config::update ( )

Update the configuration.

This method is to be called only on the application node on an initialized configuration. Dirty objects on the config are committed, i.e., the View, Canvas and Observer, and any changes on the configuration are effected. Changes may be caused by the eq::admin API or by the application, e.g., through a layout change on a Canvas. Any change causes an implicit finish of all outstanding frames.

This function always returns false when a resource failed to initialize or exit. When robustness is not activated, the config is exited by the update upon failure. When robustness is activated, the config keeps running and may be used with reduced functionality.

Returns:
true if the configuration update was successful, false if a resource failed to initialize or exit.
Version:
1.0

The documentation for this class was generated from the following file:
Generated on Sun May 8 2011 19:11:09 for Equalizer 1.0 by  doxygen 1.7.3