A configuration is a visualization session driven by an application. More...
#include <config.h>
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::CommandQueue * | getMainThreadQueue () |
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. | |
MessagePump * | getMessagePump () |
const Channel * | findChannel (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 ConfigEvent * | nextEvent () |
Get the next event. | |
const ConfigEvent * | tryNextEvent () |
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 |
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.
Definition at line 53 of file include/eq/client/config.h.
eq::Config::Config | ( | ServerPtr | parent ) |
Construct a new config.
virtual eq::Config::~Config | ( | ) | [virtual] |
Destruct a config.
Reimplemented from eq::fabric::Config< Server, Config, Observer, Layout, Canvas, Node, ConfigVisitor >.
Reimplemented in eqNbody::Config, eqPixelBench::Config, eqPly::Config, and eVolve::Config.
bool eq::Config::checkEvent | ( | ) | const [inline] |
Definition at line 315 of file include/eq/client/config.h.
References eq::net::CommandQueue::isEmpty().
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.
object | the 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.
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.
Referenced by eVolve::EVolve::run(), and eqPly::EqPly::run().
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)
Referenced by eVolve::EVolve::run(), and eqPly::EqPly::run().
void eq::Config::freezeLoadBalancing | ( | const bool | onOff ) |
ClientPtr eq::Config::getClient | ( | ) |
ConstClientPtr eq::Config::getClient | ( | ) | const |
uint32_t eq::Config::getCurrentFrame | ( | ) | const [inline] |
Definition at line 77 of file include/eq/client/config.h.
uint32_t eq::Config::getFinishedFrame | ( | ) | const [inline] |
Definition at line 80 of file include/eq/client/config.h.
References eq::base::Monitor< T >::get().
MessagePump* eq::Config::getMessagePump | ( | ) |
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.
Definition at line 106 of file include/eq/client/config.h.
References eq::base::Clock::getTime64().
virtual bool eq::Config::handleEvent | ( | const ConfigEvent * | event ) | [virtual] |
Handle one config event.
event | the event. |
Reimplemented in eqNbody::Config, eqPixelBench::Config, eqPly::Config, and eVolve::Config.
Referenced by eqNbody::Config::handleEvent().
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.
Referenced by eqPly::EqPly::run().
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().
initID | an identifier to be passed to all init methods. |
bool eq::Config::isRunning | ( | ) | const [inline] |
Definition at line 90 of file include/eq/client/config.h.
Referenced by eVolve::EVolve::run(), and eqPly::EqPly::run().
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.
Referenced by eqPly::EqPly::run().
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.
node | the 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.
frameNumber | the frame to release. |
Definition at line 261 of file include/eq/client/config.h.
void eq::Config::sendEvent | ( | ConfigEvent & | event ) |
Send an event to the application node.
event | the event. |
Referenced by eqPly::Channel::frameViewFinish().
virtual void eq::Config::setLatency | ( | const uint32_t | latency ) | [virtual] |
Reimplemented from eq::fabric::Config< Server, Config, Observer, Layout, Canvas, Node, ConfigVisitor >.
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().
frameID | a per-frame identifier passed to all rendering methods. |
Reimplemented in eqPixelBench::Config.
Referenced by eqPixelBench::Config::startFrame().
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.
void eq::Config::stopRunning | ( | ) | [inline] |
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.
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.