Equalizer
1.6.1
|
A configuration is a visualization session driven by an application. More...
#include <config.h>
Public Types | |
typedef fabric::Config< Server, Config, Observer, Layout, Canvas, Node, ConfigVisitor > | Super |
base class | |
Public Types inherited from eq::fabric::Config< Server, Config, Observer, Layout, Canvas, Node, ConfigVisitor > | |
typedef std::vector< Observer * > | Observers |
A vector of observers. | |
typedef std::vector< Layout * > | Layouts |
A vector of layouts. | |
typedef std::vector< Canvas * > | Canvases |
A vector of canvases. | |
typedef std::vector< Node * > | Nodes |
A vector of nodes. | |
enum | FAttribute |
Floating-point attributes. | |
enum | IAttribute |
Integer attributes. More... | |
Public Types inherited from eq::fabric::Object | |
enum | DirtyBits { DIRTY_NAME = Serializable::DIRTY_CUSTOM << 0, DIRTY_USERDATA = Serializable::DIRTY_CUSTOM << 1, DIRTY_ERROR = Serializable::DIRTY_CUSTOM << 2, DIRTY_TASKS = Serializable::DIRTY_CUSTOM << 3, DIRTY_REMOVED = Serializable::DIRTY_CUSTOM << 4, DIRTY_SERIAL = Serializable::DIRTY_CUSTOM << 5, DIRTY_CUSTOM = Serializable::DIRTY_CUSTOM << 6, DIRTY_OBJECT_BITS = DIRTY_NAME | DIRTY_USERDATA | DIRTY_ERROR } |
The changed parts of the object since the last pack(). More... | |
Public Member Functions | |
Config (ServerPtr parent) | |
Construct a new config. More... | |
virtual | ~Config () |
Destruct a config. More... | |
void | setupMessagePump (Pipe *pipe) |
void | setupServerConnections (const std::string &connectionData) |
Data Access | |
ClientPtr | getClient () |
ConstClientPtr | getClient () const |
co::NodePtr | getApplicationNode () |
co::CommandQueue * | getMainThreadQueue () |
co::CommandQueue * | getCommandThreadQueue () |
uint32_t | getCurrentFrame () const |
uint32_t | getFinishedFrame () const |
GLStats::Data | getStatistics () const |
bool | isRunning () const |
void | stopRunning () |
Stop the config. More... | |
int64_t | getTime () const |
Get the current time in milliseconds. More... | |
MessagePump * | getMessagePump () |
const Channel * | findChannel (const std::string &name) const |
Operations | |
virtual bool | init (const uint128_t &initID) |
Initialize this configuration. More... | |
virtual bool | exit () |
Exit this configuration. More... | |
bool | update () |
Update the configuration. More... | |
virtual void | setLatency (const uint32_t latency) |
Object registry. | |
virtual bool | registerObject (co::Object *object) |
Register a distributed object. More... | |
virtual void | deregisterObject (co::Object *object) |
Deregister a distributed object. More... | |
virtual bool | mapObject (co::Object *object, const UUID &id, const uint128_t &version=co::VERSION_OLDEST) |
Map a distributed object. More... | |
virtual uint32_t | mapObjectNB (co::Object *object, const UUID &id, const uint128_t &version=co::VERSION_OLDEST) |
Start mapping a distributed object. More... | |
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. More... | |
virtual bool | mapObjectSync (const uint32_t requestID) |
Finalize the mapping of a distributed object. More... | |
virtual void | unmapObject (co::Object *object) |
Unmap a mapped object. More... | |
void | releaseObject (co::Object *object) |
Convenience method to deregister or unmap an object. More... | |
Frame Control | |
virtual uint32_t | startFrame (const uint128_t &frameID) |
Request a new frame of rendering. More... | |
virtual uint32_t | finishFrame () |
Finish the rendering of a frame. More... | |
virtual uint32_t | finishAllFrames () |
Finish rendering all pending frames. More... | |
void | releaseFrameLocal (const uint32_t frameNumber) |
Release the local synchronization of the config for a frame. More... | |
void | stopFrames () |
Asynchronously signal all channels to interrupt their rendering. More... | |
Event handling | |
const ConfigEvent * | nextEvent () |
Get the next event. More... | |
const ConfigEvent * | tryNextEvent () |
Try to get the next event. More... | |
void | sendEvent (ConfigEvent &event) |
Send an (old) event to the application node. More... | |
virtual bool | handleEvent (const ConfigEvent *event) |
Handle one (old) config event. More... | |
EventOCommand | sendEvent (const uint32_t type) |
Send an event to the application node. More... | |
EventICommand | getNextEvent (const uint32_t timeout=LB_TIMEOUT_INDEFINITE) const |
Get the next event. More... | |
virtual bool | handleEvent (EventICommand command) |
Handle one config event. More... | |
bool | checkEvent () const |
virtual void | handleEvents () |
Handle all config events. More... | |
void | addStatistic (const uint32_t originator, const Statistic &stat) |
Add an statistic event to the statistics overlay. More... | |
Public Member Functions inherited from eq::fabric::Config< Server, Config, Observer, Layout, Canvas, Node, ConfigVisitor > | |
virtual void | output (std::ostream &) const |
void | create (Observer **observer) |
void | create (Layout **layout) |
void | create (Canvas **canvas) |
void | create (Node **node) |
void | release (Observer *observer) |
void | release (Layout *layout) |
void | release (Canvas *canvas) |
void | release (Node *node) |
EQFABRIC_INL lunchbox::RefPtr < Server > | getServer () |
EQFABRIC_INL lunchbox::RefPtr < const Server > | getServer () const |
const Observers & | getObservers () const |
const Layouts & | getLayouts () const |
const Canvases & | getCanvases () const |
EQFABRIC_INL uint32_t | getTimeout () const |
const Nodes & | getNodes () const |
EQFABRIC_INL Node * | findAppNode () |
EQFABRIC_INL const Node * | findAppNode () const |
EQFABRIC_INL VisitorResult | accept (ConfigVisitor &visitor) |
Perform a depth-first traversal of this config. More... | |
EQFABRIC_INL VisitorResult | accept (ConfigVisitor &visitor) const |
Const-version of accept(). More... | |
EQFABRIC_INL T * | find (const uint128_t &id) |
EQFABRIC_INL const T * | find (const uint128_t &id) const |
EQFABRIC_INL T * | find (const std::string &name) |
EQFABRIC_INL const T * | find (const std::string &name) const |
void | find (const uint128_t &id, T **result) |
void | find (const std::string &name, const T **result) const |
Observer * | getObserver (const ObserverPath &path) |
Layout * | getLayout (const LayoutPath &path) |
Canvas * | getCanvas (const CanvasPath &path) |
virtual void | updateCanvas (Canvas *) |
virtual void | exitCanvas (Canvas *) |
uint32_t | getLatency () const |
virtual EQFABRIC_INL void | restore () |
void | setFAttribute (const FAttribute attr, const float value) |
void | setIAttribute (const IAttribute attr, const int32_t value) |
float | getFAttribute (const FAttribute attr) const |
int32_t | getIAttribute (const IAttribute attr) const |
Public Member Functions inherited from eq::fabric::Object | |
virtual bool | isDirty () const |
virtual void | backup () |
void | setName (const std::string &name) |
Set the name of the object. More... | |
const std::string & | getName () const |
void | setUserData (co::Object *userData) |
Set user-specific data. More... | |
co::Object * | getUserData () |
const co::Object * | getUserData () const |
void | setError (const int32_t error) |
Set an error code why the last operation failed. More... | |
eq::fabric::Error | getError () const |
uint32_t | getTasks () const |
Return the set of tasks this channel might execute in the worst case. More... | |
uint32_t | getSerial () const |
Protected Member Functions | |
virtual void | attach (const UUID &id, const uint32_t instanceID) |
virtual void | notifyAttached () |
virtual void | notifyDetach () |
virtual void | changeLatency (const uint32_t latency) |
virtual bool | mapViewObjects () const |
Protected Member Functions inherited from eq::fabric::Config< Server, Config, Observer, Layout, Canvas, Node, ConfigVisitor > | |
EQFABRIC_INL | Config (lunchbox::RefPtr< Server > parent) |
virtual EQFABRIC_INL void | serialize (co::DataOStream &os, const uint64_t dirtyBits) |
virtual EQFABRIC_INL void | deserialize (co::DataIStream &is, const uint64_t dirtyBits) |
virtual void | _removeChild (const UUID &) |
void | setAppNodeID (const co::NodeID &nodeID) |
const co::NodeID & | getAppNodeID () const |
virtual bool | mapNodeObjects () const |
virtual VisitorResult | _acceptCompounds (ConfigVisitor &) |
virtual VisitorResult | _acceptCompounds (ConfigVisitor &) const |
Node * | _findNode (const uint128_t &id) |
virtual EQFABRIC_INL uint128_t | commit (const uint32_t incarnation=CO_COMMIT_NEXT) |
Protected Member Functions inherited from eq::fabric::Object | |
Object () | |
Construct a new Object. More... | |
virtual | ~Object () |
Destruct the object. More... | |
virtual bool | hasMasterUserData () |
virtual uint32_t | getUserDataLatency () const |
void | setTasks (const uint32_t tasks) |
void | postRemove (Object *child) |
virtual void | removeChild (const UUID &) |
template<class C , class S > | |
void | commitChild (C *child, S *sender, uint32_t cmd, const uint32_t incarnation) |
template<class C > | |
void | commitChild (C *child, const uint32_t incarnation) |
template<class C , class S > | |
void | commitChildren (const std::vector< C * > &children, S *sender, uint32_t cmd, const uint32_t incarnation) |
template<class C > | |
void | commitChildren (const std::vector< C * > &children, uint32_t cmd, const uint32_t incarnation) |
template<class C > | |
void | commitChildren (const std::vector< C * > &children, const uint32_t incarnation) |
template<class C > | |
void | syncChildren (const std::vector< C * > &children) |
template<class P , class C > | |
void | releaseChildren (const std::vector< C * > &children) |
bool | _cmdSync (co::ICommand &command) |
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 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.
Definition at line 55 of file include/eq/client/config.h.
eq::Config::Config | ( | ServerPtr | parent | ) |
Construct a new config.
|
virtual |
Destruct a config.
Reimplemented from eq::fabric::Config< Server, Config, Observer, Layout, Canvas, Node, ConfigVisitor >.
Reimplemented in eqPly::Config, eVolve::Config, and eqPixelBench::Config.
void eq::Config::addStatistic | ( | const uint32_t | originator, |
const Statistic & | stat | ||
) |
Add an statistic event to the statistics overlay.
Thread safe.
originator | the originator serial id. |
stat | the statistic event. |
bool eq::Config::checkEvent | ( | ) | const |
|
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. |
|
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 eqPly::Config, and eVolve::Config.
Referenced by eVolve::Config::exit(), and eqPly::Config::exit().
|
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 |
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().
co::NodePtr eq::Config::getApplicationNode | ( | ) |
Referenced by eqPly::Config::getModel(), and eqPly::Config::loadData().
ClientPtr eq::Config::getClient | ( | ) |
Referenced by eqPly::Config::getModel().
ConstClientPtr eq::Config::getClient | ( | ) | const |
uint32_t eq::Config::getCurrentFrame | ( | ) | const |
uint32_t eq::Config::getFinishedFrame | ( | ) | const |
Referenced by eqPly::EqPly::run().
MessagePump* eq::Config::getMessagePump | ( | ) |
EventICommand eq::Config::getNextEvent | ( | const uint32_t | timeout = LB_TIMEOUT_INDEFINITE | ) | const |
Get the next event.
To be called only on the application node.
The returned event command is valid until it gets out of scope. This method does not block if the given timeout is 0. Not thread safe.
timeout | time in ms to wait for incoming events |
Referenced by eqPly::EqPly::run().
int64_t eq::Config::getTime | ( | ) | const |
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 lunchbox::Log clock.
|
virtual |
Handle one (old) config event.
Thread safe.
This function handles all events which did exist in Equalizer 1.5.0. Events introduced in 1.5.1 or later are handled by the other handleEvent. Equalizer 2.0 will drop this method and send all events using EventICommand instead of the ConfigEvent struct.
event | the event. |
Reimplemented in eqPly::Config, and eVolve::Config.
Referenced by eqPixelBench::Config::handleEvent(), eVolve::Config::handleEvent(), and eqPly::Config::handleEvent().
|
virtual |
Handle one config event.
Thread safe.
command | the event command. |
Reimplemented in eqPly::Config, and eqPixelBench::Config.
|
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. Not thread safe.
Referenced by eqPly::EqPly::run().
|
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. |
Referenced by eVolve::Config::init(), and eqPly::Config::init().
bool eq::Config::isRunning | ( | ) | const |
Referenced by eVolve::EVolve::run(), and eqPly::EqPly::run().
|
virtual |
Map a distributed object.
Provided for symmetry with deregisterObject. Forwards mapping to local client node.
Referenced by eVolve::Pipe::configInit(), eqPly::Pipe::configInit(), and eVolve::Config::mapData().
|
virtual |
Start mapping a distributed object.
Referenced by eqPly::Config::loadData().
|
virtual |
Start mapping a distributed object from a known master.
|
virtual |
Finalize the mapping of a distributed object.
Referenced by eqPly::Config::loadData().
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.
|
virtual |
Register a distributed object.
Provided for symmetry with deregisterObject. Forwards registration to local client node.
Referenced by eVolve::Config::init(), and eqPly::Config::init().
void eq::Config::releaseFrameLocal | ( | const uint32_t | frameNumber | ) |
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. |
void eq::Config::releaseObject | ( | co::Object * | object | ) |
Convenience method to deregister or unmap an object.
void eq::Config::sendEvent | ( | ConfigEvent & | event | ) |
Send an (old) event to the application node.
Should not be used by applications, other then sending any event defined by Equalizer 1.5.0.
event | the event. |
Referenced by eqPly::Channel::frameViewFinish().
EventOCommand eq::Config::sendEvent | ( | const uint32_t | type | ) |
Send an event to the application node.
The returned command can be used to pass additional data to the event. The event will be send after the command is destroyed, aka when it is running out of scope. Thread safe.
type | the event type. |
|
virtual |
Reimplemented from eq::fabric::Config< Server, Config, Observer, Layout, Canvas, Node, ConfigVisitor >.
|
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(), eVolve::Config::startFrame(), and eqPly::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 | ( | ) |
Stop the config.
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.
|
virtual |
Unmap a mapped object.
Provided for symmetry with deregisterObject. Forwards unmapping to local client node.
Referenced by eVolve::Pipe::configExit(), eqPly::Pipe::configExit(), eqPly::Config::loadData(), and eVolve::Config::mapData().
bool eq::Config::update | ( | ) |
Update the configuration.
This method is to be called only on the application node only on an initialized configuration. Dirty objects on the config are committed, i.e., the View, Canvas and Observer, and any changes to 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.