A configuration is one visualization session driven by an application. More...
#include <config.h>


Public Member Functions | |
| Config (ServerPtr parent) | |
| Construct a new config. | |
| virtual | ~Config () |
| Destruct a config. | |
Data Access | |
| const std::string & | getName () const |
| ClientPtr | getClient () |
| ServerPtr | getServer () |
| CommandQueue * | getNodeThreadQueue () |
| uint32_t | getCurrentFrame () const |
| uint32_t | getFinishedFrame () const |
| uint32_t | getLatency () const |
| const NodeVector & | getNodes () const |
| const ObserverVector & | getObservers () const |
| Observer * | findObserver (const uint32_t id) |
| const Observer * | findObserver (const uint32_t id) const |
| const LayoutVector & | getLayouts () const |
| Layout * | findLayout (const uint32_t id) |
| View * | findView (const uint32_t id) |
| const CanvasVector & | getCanvases () const |
| VisitorResult | accept (ConfigVisitor &visitor) |
| Traverse this config and all children using a config visitor. | |
| VisitorResult | accept (ConfigVisitor &visitor) const |
| Const-version of accept(). | |
| void | getStatistics (std::vector< FrameStatistics > &stats) |
| Get all received statistics. | |
| bool | isRunning () const |
| void | stopRunning () |
| Stop the config. | |
| int64_t | getTime () const |
| Get the current time in milliseconds. | |
Operations | |
| virtual bool | init (const uint32_t initID) |
| Initialize this configuration. | |
| virtual bool | exit () |
| Exit this configuration. | |
| void | freezeLoadBalancing (const bool onOff) |
Frame Control | |
| virtual uint32_t | startFrame (const uint32_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. | |
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. | |
Error Information | |
| const std::string & | getErrorMessage () const |
Friends | |
| class | Server |
| class | Node |
| class | ConfigDeserializer |
|
| |
| void | setupMessagePump (Pipe *pipe) |
| Set up the config's message pump for the given pipe. | |
| virtual void | notifyMapped (net::NodePtr node) |
A configuration is one 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 57 of file lib/client/config.h.
| eq::Config::Config | ( | ServerPtr | parent | ) |
Construct a new config.
Definition at line 50 of file lib/client/config.cpp.
References EQINFO, and eq::base::Log::setClock().

| eq::Config::~Config | ( | ) | [virtual] |
Destruct a config.
Reimplemented in eqNbody::Config, eqPixelBench::Config, eqPly::Config, and eVolve::Config.
Definition at line 64 of file lib/client/config.cpp.
References EQINFO, eq::CommandQueue::flush(), eq::base::Log::setClock(), tryNextEvent(), and eq::base::UUID::ZERO.

| const std::string& eq::Config::getName | ( | ) | const [inline] |
| ClientPtr eq::Config::getClient | ( | ) |
Definition at line 293 of file lib/client/config.cpp.
References getServer().
Referenced by exit(), finishAllFrames(), finishFrame(), getNodeThreadQueue(), init(), and setupMessagePump().


| ServerPtr eq::Config::getServer | ( | ) |
Reimplemented from eq::net::Session.
Definition at line 285 of file lib/client/config.cpp.
References eq::base::RefPtr< T >::get().
Referenced by getClient(), notifyMapped(), and eq::Node::releaseFrame().


| CommandQueue * eq::Config::getNodeThreadQueue | ( | ) |
For internal use only.
Definition at line 109 of file lib/client/config.cpp.
References getClient().
Referenced by eq::Node::attachToSession().


| uint32_t eq::Config::getCurrentFrame | ( | ) | const [inline] |
Definition at line 81 of file lib/client/config.h.
| uint32_t eq::Config::getFinishedFrame | ( | ) | const [inline] |
Definition at line 84 of file lib/client/config.h.
References eq::base::Monitor< T >::get().

| uint32_t eq::Config::getLatency | ( | ) | const [inline] |
Definition at line 91 of file lib/client/config.h.
Referenced by eq::Layout::deserialize(), eVolve::Config::init(), and eqPly::Config::init().

| const NodeVector& eq::Config::getNodes | ( | ) | const [inline] |
Definition at line 97 of file lib/client/config.h.
Referenced by eq::Node::releaseFrameLocal().

| const ObserverVector& eq::Config::getObservers | ( | ) | const [inline] |
Definition at line 100 of file lib/client/config.h.
| Observer * eq::Config::findObserver | ( | const uint32_t | id | ) |
Definition at line 145 of file lib/client/config.cpp.
References accept().
Referenced by eq::View::deserialize().


| const Observer * eq::Config::findObserver | ( | const uint32_t | id | ) | const |
Definition at line 152 of file lib/client/config.cpp.
References accept().

| const LayoutVector& eq::Config::getLayouts | ( | ) | const [inline] |
Definition at line 109 of file lib/client/config.h.
| Layout * eq::Config::findLayout | ( | const uint32_t | id | ) |
Definition at line 159 of file lib/client/config.cpp.
References accept().
Referenced by eq::Canvas::deserialize().


| View * eq::Config::findView | ( | const uint32_t | id | ) |
Definition at line 166 of file lib/client/config.cpp.
References accept().
Referenced by eVolve::Config::handleEvent(), eqPly::Config::handleEvent(), and handleEvent().


| const CanvasVector& eq::Config::getCanvases | ( | ) | const [inline] |
Definition at line 118 of file lib/client/config.h.
Referenced by eVolve::Config::handleEvent(), eqPly::Config::handleEvent(), eVolve::Config::init(), and eqPly::Config::init().

| VisitorResult eq::Config::accept | ( | ConfigVisitor & | visitor | ) |
Traverse this config and all children using a config visitor.
| visitor | the visitor. |
Definition at line 275 of file lib/client/config.cpp.
Referenced by findLayout(), findObserver(), findView(), and startFrame().

| VisitorResult eq::Config::accept | ( | ConfigVisitor & | visitor | ) | const |
Const-version of accept().
Definition at line 280 of file lib/client/config.cpp.
| void eq::Config::getStatistics | ( | std::vector< FrameStatistics > & | stats | ) |
Get all received statistics.
For internal use only.
Definition at line 695 of file lib/client/config.cpp.
References eq::base::Monitor< T >::get(), eq::base::Lock::set(), and eq::base::Lock::unset().
Referenced by eq::Channel::drawStatistics().


| bool eq::Config::isRunning | ( | ) | const [inline] |
Definition at line 140 of file lib/client/config.h.
Referenced by eVolve::EVolve::run(), and eqPly::EqPly::run().

| void eq::Config::stopRunning | ( | ) | [inline] |
| 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 Log clock.
Definition at line 156 of file lib/client/config.h.
References eq::base::Clock::getTime64().
Referenced by eq::ChannelStatistics::ChannelStatistics(), finishFrame(), eq::Pipe::getFrameTime(), eqPly::Config::isUserEvent(), and eq::ChannelStatistics::~ChannelStatistics().


| bool eq::Config::init | ( | const uint32_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 getErrorMessage().
| initID | an identifier to be passed to all init methods. |
Definition at line 364 of file lib/client/config.cpp.
References eq::net::Session::_requestHandler, getClient(), handleEvents(), eq::base::RequestHandler::isServed(), eq::base::RequestHandler::registerRequest(), eq::net::Session::send(), and eq::base::RequestHandler::waitRequest().
Referenced by eVolve::Config::init(), and eqPly::Config::init().


| 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.
Definition at line 388 of file lib/client/config.cpp.
References eq::net::Session::_requestHandler, finishAllFrames(), eq::CommandQueue::flush(), getClient(), eq::base::RequestHandler::isServed(), eq::base::RequestHandler::registerRequest(), eq::net::Session::send(), tryNextEvent(), eq::base::RequestHandler::waitRequest(), and eq::base::UUID::ZERO.
Referenced by eqPly::Config::exit(), and eqNbody::Config::exit().


| void eq::Config::freezeLoadBalancing | ( | const bool | onOff | ) |
Definition at line 752 of file lib/client/config.cpp.
References eq::net::Session::send().

| uint32_t eq::Config::startFrame | ( | const uint32_t | frameID | ) | [virtual] |
Request a new frame of rendering.
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. If the active Layout of a Canvas has been changed since the last frame start, all outstanding rendering is completed using finishAllFrames().
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.
Definition at line 415 of file lib/client/config.cpp.
References accept(), EQLOG, eq::StatisticSampler< Owner >::event, finishAllFrames(), eq::base::LOG_ANY, eq::net::Session::send(), and eq::Event::statistic.
Referenced by eqPixelBench::Config::startFrame().


| 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)
Definition at line 451 of file lib/client/config.cpp.
References EQLOG, eq::StatisticSampler< Owner >::event, getClient(), getTime(), handleEvent(), handleEvents(), eq::base::LOG_ANY, eq::Event::statistic, and eq::base::Monitor< T >::waitGE().
Referenced by eVolve::EVolve::run(), and eqPly::EqPly::run().


| 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.
Definition at line 503 of file lib/client/config.cpp.
References EQLOG, getClient(), handleEvents(), eq::base::LOG_ANY, and eq::net::Session::send().
Referenced by exit(), eVolve::EVolve::run(), eqPly::EqPly::run(), and startFrame().


| 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 274 of file lib/client/config.h.
Referenced by eq::Node::releaseFrameLocal().

| void eq::Config::sendEvent | ( | ConfigEvent & | event | ) |
Send an event to the application node.
| event | the event. |
Definition at line 521 of file lib/client/config.cpp.
References EQLOG, eq::net::Session::getID(), eq::net::Session::getLocalNode(), eq::LOG_EVENTS, eq::Event::statistic, eq::Event::STATISTIC, and eq::Event::type.
Referenced by eqPixelBench::Channel::frameStart(), eqPly::Channel::frameViewFinish(), eq::Window::processEvent(), and eq::Channel::processEvent().


| 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.
Definition at line 539 of file lib/client/config.cpp.
References eq::CommandQueue::pop().
Referenced by eqPly::EqPly::run().


| 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.
Definition at line 547 of file lib/client/config.cpp.
References eq::CommandQueue::tryPop().
Referenced by exit(), handleEvents(), and ~Config().


| bool eq::Config::checkEvent | ( | ) | const [inline] |
Definition at line 316 of file lib/client/config.h.
References eq::net::CommandQueue::isEmpty().

| 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.
Definition at line 559 of file lib/client/config.cpp.
References EQVERB, handleEvent(), and tryNextEvent().
Referenced by finishAllFrames(), finishFrame(), init(), and eqPly::EqPly::run().


| 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.
Definition at line 569 of file lib/client/config.cpp.
References EQLOG, eq::Event::EXIT, findView(), eq::View::handleEvent(), eq::Event::KEY_PRESS, eq::Event::keyPress, eq::LOG_STATS, eq::Event::originator, eq::Event::POINTER_BUTTON_PRESS, eq::Event::pointerButtonPress, eq::Event::STATISTIC, eq::Event::type, eq::Event::VIEW_RESIZE, and eq::Event::WINDOW_CLOSE.
Referenced by finishFrame(), eqNbody::Config::handleEvent(), and handleEvents().


| const std::string& eq::Config::getErrorMessage | ( | ) | const [inline] |
Definition at line 343 of file lib/client/config.h.
Referenced by eVolve::EVolve::run(), and eqPly::EqPly::run().

| void eq::Config::setupMessagePump | ( | Pipe * | pipe | ) |
Set up the config's message pump for the given pipe.
For internal use only.
Used by non-threaded and AGL pipes.
Definition at line 709 of file lib/client/config.cpp.
References eq::Pipe::createMessagePump(), getClient(), eq::Pipe::getWindowSystem(), and eq::WINDOW_SYSTEM_AGL.

| void eq::Config::notifyMapped | ( | net::NodePtr | node | ) | [protected, virtual] |
For internal use only.
Reimplemented from eq::net::Session.
Definition at line 82 of file lib/client/config.cpp.
References eq::net::Dispatcher::_cmdUnknown(), getServer(), and eq::net::Dispatcher::registerCommand().

0.9.1 by
1.6.1