Classes | Public Member Functions | Public Types | Protected Member Functions | Friends

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
net::CommandQueuegetMainThreadQueue ()
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)
virtual void deregisterObject (net::Object *object)
 Deregister a distributed 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 notifyMapped (net::LocalNodePtr node)
 Notification that this session has been mapped to a node.
virtual void notifyAttached ()
virtual void changeLatency (const uint32_t latency)
virtual void unmap ()
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 net::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 subclassed 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 53 of file include/eq/client/config.h.


Constructor & Destructor Documentation

eq::Config::Config ( ServerPtr  parent )

Construct a new config.

Version:
1.0
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 315 of file include/eq/client/config.h.

References eq::net::CommandQueue::isEmpty().

Here is the call graph for this function:

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

Reimplemented from eq::net::Session.

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, and eVolve::Config.

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 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 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
ClientPtr eq::Config::getClient (  )
Returns:
the local client node.
Version:
1.0
ConstClientPtr eq::Config::getClient (  ) const
Returns:
the local client node.
Version:
1.0
uint32_t eq::Config::getCurrentFrame (  ) const [inline]
Returns:
the frame number of the last frame started.
Version:
1.0

Definition at line 77 of file include/eq/client/config.h.

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

Definition at line 80 of file include/eq/client/config.h.

References eq::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 base::Log clock.

Returns:
the global time in ms.
Version:
1.0

Definition at line 106 of file include/eq/client/config.h.

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

Here is the call 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, and eVolve::Config.

Referenced by eqNbody::Config::handleEvent().

Here is the caller graph for this function:

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
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 90 of file include/eq/client/config.h.

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

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::notifyMapped ( net::LocalNodePtr  node ) [protected, virtual]

Notification that this session has been mapped to a node.

Typically used by sub-classes to register command handlers. Always call the parent's notifyMapped() first.

Parameters:
nodethe node to which the session has been mapped.

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

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 261 of file include/eq/client/config.h.

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

Send an event to the application node.

Parameters:
eventthe event.
Version:
1.0

Referenced by 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 93 of file include/eq/client/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
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 Mon Dec 6 2010 09:56:36 for Equalizer 1.0-alpha by  1.7.2