eq::Config Class Reference

The configuration groups all processes of the application in a single net::Session. More...

#include <config.h>

Inheritance diagram for eq::Config:

Inheritance graph
[legend]
Collaboration diagram for eq::Config:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Config (ServerPtr parent)
 Constructs a new config.
virtual ~Config ()
 Destructs a config.
void freezeLoadBalancing (const bool onOff)
 Undocumented.
void setWindowSystem (const WindowSystem windowSystem)
 Set the window system for the config's message pump, used by non-threaded pipes.
Data Access
ClientPtr getClient ()
ServerPtr getServer ()
CommandQueuegetNodeThreadQueue ()
uint32_t getCurrentFrame () const
uint32_t getFinishedFrame () const
uint32_t getLatency () const
const NodeVectorgetNodes () const
const ObserverVectorgetObservers () const
ObserverfindObserver (const uint32_t id)
const LayoutVectorgetLayouts () const
LayoutfindLayout (const uint32_t id)
ViewfindView (const uint32_t id)
const CanvasVectorgetCanvases () const
const std::string & getName () const
VisitorResult accept (ConfigVisitor &visitor)
 Traverse this config and all children using a config visitor.
void getStatistics (std::vector< FrameStatistics > &stats)
 Get all received statistics.
bool isRunning () const
void stopRunning ()
 Stop running the config.
int64_t getTime () const
Operations.
virtual bool init (const uint32_t initID)
 Initializes this configuration.
virtual bool exit ()
 Exits this configuration.
Frame Control
virtual uint32_t startFrame (const uint32_t frameID)
 Requests 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 ConfigEventnextEvent ()
 Get the next received event on the application node.
const ConfigEventtryNextEvent ()
 Try to get an event on the application node.
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

Protected Member Functions

virtual void notifyMapped (net::NodePtr node)

Friends

class Server
class Node
class ConfigDeserializer


Detailed Description

The configuration groups all processes of the application in a single net::Session.

Definition at line 41 of file lib/client/config.h.


Constructor & Destructor Documentation

eq::Config::Config ( ServerPtr  parent  ) 

Constructs a new config.

Definition at line 51 of file lib/client/config.cpp.

References eq::base::Log::setClock().

Here is the call graph for this function:

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

Destructs a config.

Reimplemented in eqPly::Config.

Definition at line 64 of file lib/client/config.cpp.

References EQINFO, eq::CommandQueue::flush(), eq::net::Command::release(), eq::base::Log::setClock(), tryNextEvent(), and eq::base::UUID::ZERO.

Here is the call graph for this function:


Member Function Documentation

ServerPtr eq::Config::getServer (  ) 

Returns:
the server hosting this session, or 0 if the session is not mapped..

Reimplemented from eq::net::Session.

Definition at line 273 of file lib/client/config.cpp.

References eq::base::RefPtr< T >::get().

Referenced by notifyMapped(), eq::releaseConfig(), and eq::Node::releaseFrame().

Here is the call graph for this function:

Here is the caller graph for this function:

const NodeVector& eq::Config::getNodes (  )  const [inline]

Returns:
the vector of nodes instantiated on this process.

Definition at line 62 of file lib/client/config.h.

Referenced by eq::Node::releaseFrameLocal().

Here is the caller graph for this function:

const ObserverVector& eq::Config::getObservers (  )  const [inline]

Returns:
the vector of observers, app-node only.

Definition at line 65 of file lib/client/config.h.

Observer * eq::Config::findObserver ( const uint32_t  id  ) 

Returns:
the observer of the given identifier, or 0.

Definition at line 145 of file lib/client/config.cpp.

References accept().

Referenced by eq::View::deserialize().

Here is the call graph for this function:

Here is the caller graph for this function:

const LayoutVector& eq::Config::getLayouts (  )  const [inline]

Returns:
the vector of layouts, app-node only.

Definition at line 71 of file lib/client/config.h.

Layout * eq::Config::findLayout ( const uint32_t  id  ) 

Returns:
the layout of the given identifier, or 0.

Definition at line 152 of file lib/client/config.cpp.

References accept().

Referenced by eq::Canvas::deserialize().

Here is the call graph for this function:

Here is the caller graph for this function:

View * eq::Config::findView ( const uint32_t  id  ) 

Returns:
the view of the given identifier, or 0.

Definition at line 159 of file lib/client/config.cpp.

References accept().

Referenced by eqPly::Config::handleEvent(), and handleEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

const CanvasVector& eq::Config::getCanvases (  )  const [inline]

Returns:
the vector of canvases, app-node only.

Definition at line 80 of file lib/client/config.h.

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

Here is the caller graph for this function:

const std::string& eq::Config::getName (  )  const [inline]

Returns:
the name of this config.

Definition at line 83 of file lib/client/config.h.

VisitorResult eq::Config::accept ( ConfigVisitor visitor  ) 

Traverse this config and all children using a config visitor.

Parameters:
visitor the visitor.
Returns:
the result of the visitor traversal.

Definition at line 268 of file lib/client/config.cpp.

Referenced by findLayout(), findObserver(), findView(), and startFrame().

Here is the caller graph for this function:

void eq::Config::getStatistics ( std::vector< FrameStatistics > &  stats  ) 

Get all received statistics.

Definition at line 669 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().

Here is the call graph for this function:

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 happened.

Definition at line 100 of file lib/client/config.h.

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

Here is the caller graph for this function:

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

Stop running the config.

Definition at line 103 of file lib/client/config.h.

int64_t eq::Config::getTime (  )  const [inline]

Returns:
the global time in ms.

Definition at line 106 of file lib/client/config.h.

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

Referenced by finishFrame(), eq::Pipe::getFrameTime(), and eqPly::Config::needsRedraw().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Initializes this configuration.

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

Definition at line 352 of file lib/client/config.cpp.

References eq::net::Session::_requestHandler, handleEvents(), eq::base::RequestHandler::isServed(), eq::base::RequestHandler::registerRequest(), eq::net::Session::send(), and eq::base::RequestHandler::waitRequest().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Exits this configuration.

A config which could not be exited properly may not be re-initialized.

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

Reimplemented in eqPly::Config.

Definition at line 375 of file lib/client/config.cpp.

References eq::net::Session::_requestHandler, finishAllFrames(), eq::CommandQueue::flush(), eq::base::RequestHandler::isServed(), eq::base::RequestHandler::registerRequest(), eq::net::Command::release(), eq::net::Session::send(), tryNextEvent(), eq::base::RequestHandler::waitRequest(), and eq::base::UUID::ZERO.

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

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t eq::Config::startFrame ( const uint32_t  frameID  )  [virtual]

Requests a new frame of rendering.

Parameters:
frameID a per-frame identifier passed to all rendering methods.
Returns:
the frame number of the new frame.

Definition at line 402 of file lib/client/config.cpp.

References accept(), eq::ConfigEvent::data, EQLOG, eq::StatisticSampler< Owner >::event, finishAllFrames(), eq::Statistic::frameNumber, eq::ConfigCommitVisitor::getChanges(), eq::base::LOG_ANY, eq::ConfigCommitVisitor::needsFinish(), eq::net::Session::send(), and eq::Event::statistic.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Finish the rendering of a frame.

Returns:
the frame number of the finished frame, or 0 if no frame has been finished.

Definition at line 426 of file lib/client/config.cpp.

References eq::ConfigEvent::data, eq::Statistic::endTime, EQLOG, eq::StatisticSampler< Owner >::event, eq::Statistic::frameNumber, getTime(), handleEvent(), handleEvents(), eq::ConfigStatistics::ignore, eq::base::LOG_ANY, eq::Event::statistic, and eq::base::Monitor< T >::waitGE().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Finish rendering all pending frames.

Returns:
the frame number of the last finished frame.

Definition at line 478 of file lib/client/config.cpp.

References EQLOG, handleEvents(), eq::base::LOG_ANY, and eq::net::Session::send().

Referenced by exit(), eqPly::EqPly::run(), and startFrame().

Here is the call graph for this function:

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.

This is used by the local node to release the local frame synchronization.

Parameters:
frameNumber the frame to release.

Definition at line 167 of file lib/client/config.h.

Referenced by eq::Node::releaseFrameLocal().

Here is the caller graph for this function:

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

Send an event to the application node.

Parameters:
event the event.

Definition at line 496 of file lib/client/config.cpp.

References eq::ConfigEvent::data, EQLOG, eq::net::Session::getID(), eq::net::Session::getLocalNode(), eq::LOG_EVENTS, eq::Event::statistic, eq::Event::STATISTIC, eq::Statistic::type, and eq::Event::type.

Referenced by eq::Window::processEvent(), and eq::Channel::processEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Get the next received event on the application node.

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

Returns:
a config event.

Definition at line 514 of file lib/client/config.cpp.

References eq::net::Command::getPacket(), eq::CommandQueue::pop(), and eq::net::Command::release().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Try to get an event on the application node.

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

Returns:
a config event, or 0 if no events are pending.

Definition at line 522 of file lib/client/config.cpp.

References eq::net::Command::getPacket(), eq::net::Command::release(), and eq::CommandQueue::tryPop().

Referenced by exit(), handleEvents(), and ~Config().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::Config::checkEvent (  )  const [inline]

Returns:
true if events are pending.

Definition at line 199 of file lib/client/config.h.

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

Here is the call graph for this function:

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

Handle all config events.

Called 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 534 of file lib/client/config.cpp.

References EQVERB, handleEvent(), and tryNextEvent().

Referenced by finishAllFrames(), finishFrame(), init(), and eqPly::EqPly::run().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Handle one config event.

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

Reimplemented in eqPly::Config.

Definition at line 544 of file lib/client/config.cpp.

References eq::PointerEvent::buttons, eq::ConfigEvent::data, EQLOG, eq::Event::EXIT, findView(), eq::Statistic::frameNumber, eq::View::handleEvent(), eq::KeyEvent::key, 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::Statistic::type, eq::Event::type, eq::Event::VIEW_RESIZE, and eq::Event::WINDOW_CLOSE.

Referenced by finishFrame(), eqPly::Config::handleEvent(), and handleEvents().

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string& eq::Config::getErrorMessage (  )  const [inline]

Returns:
the error message from the last operation.

Definition at line 250 of file lib/client/config.h.

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

Here is the caller graph for this function:

void eq::Config::setWindowSystem ( const WindowSystem  windowSystem  ) 

Set the window system for the config's message pump, used by non-threaded pipes.

For internal use only.

Definition at line 683 of file lib/client/config.cpp.

References EQINFO, EQWARN, eq::CommandQueue::getWindowSystem(), and eq::CommandQueue::setWindowSystem().

Here is the call graph for this function:

void eq::Config::notifyMapped ( net::NodePtr  node  )  [protected, virtual]

See also:
eq::net::Session::notifyMapped()

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().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Aug 10 18:58:42 2009 for Equalizer 0.9 by  doxygen 1.5.8