#include <src/EventQueueViewer.h>
The goal is to post-pone OSG-critical events (like scene graph changes) to when they can be safely executed (the update method of the viewer).
Any thread can post such events at any time, they will be executed in order they were received at the next scene graph update.
Note: This is not a whole simulator, especially there is no notion of a deterministic simulated time. But the template way of posting events was "inspired" from a more complete simulator framework. See http://nicolas.brodu.free.fr/en/programmation/crogai/index.html for a project using this simulator.
Public Member Functions | |
EventQueueViewer () | |
Parent constructor "overload". | |
EventQueueViewer (Producer::CameraConfig *cfg) | |
Parent constructor "overload". | |
EventQueueViewer (const std::string &configFile) | |
Parent constructor "overload". | |
EventQueueViewer (osg::ArgumentParser &arguments) | |
Parent constructor "overload". | |
virtual | ~EventQueueViewer () |
Parent destructor "overload". | |
virtual void | post (const GenericDispatcher *dispatcher) |
Post an event, scheduled to be executed at next frame update. | |
void | post (void(*method)()) |
Post an event, scheduled to be executed at next frame update. | |
template<class A> | |
void | post (void(*method)(A), A argument) |
Post an event, scheduled to be executed at next frame update. | |
template<class A1, class A2> | |
void | post (void(*method)(A1, A2), A1 argument1, A2 argument2) |
Post an event, scheduled to be executed at next frame update. | |
template<class A1, class A2, class A3> | |
void | post (void(*method)(A1, A2, A3), A1 argument1, A2 argument2, A3 argument3) |
Post an event, scheduled to be executed at next frame update. | |
template<class T> | |
void | post (T *object, void(T::*method)()) |
Post an event, scheduled to be executed at next frame update. | |
template<class T, class A> | |
void | post (T *object, void(T::*method)(A), A argument) |
Post an event, scheduled to be executed at next frame update. | |
template<class T, class A1, class A2> | |
void | post (T *object, void(T::*method)(A1, A2), A1 argument1, A2 argument2) |
Post an event, scheduled to be executed at next frame update. | |
template<class T, class A1, class A2, class A3> | |
void | post (T *object, void(T::*method)(A1, A2, A3), A1 argument1, A2 argument2, A3 argument3) |
Post an event, scheduled to be executed at next frame update. | |
virtual void | update () |
Process queued events, then call parent code in globally locked section to prevent concurrent modifications of the scene graph. | |
Protected Attributes | |
std::vector< const GenericDispatcher * > | events |
Globally locks or unlocks the viewer. | |
OpenThreads::Mutex | eventsAccessMutex |
OpenThreads::Mutex | globalAccessMutex |
Classes | |
struct | Dispatcher |
struct | Dispatcher1 |
struct | Dispatcher2 |
struct | Dispatcher3 |
struct | GenericDispatcher |
Base class of templatized object method wrappers This is put in the public namespace of the Viewer so it can be used with the generic post methods. More... | |
struct | StaticDispatcher |
struct | StaticDispatcher1 |
struct | StaticDispatcher2 |
struct | StaticDispatcher3 |
|
Parent constructor "overload". See parent doc. |
|
Parent constructor "overload". See parent doc. |
|
Parent constructor "overload". See parent doc. |
|
Parent constructor "overload". See parent doc. |
|
Parent destructor "overload". See parent doc. |
|
Post an event, scheduled to be executed at next frame update. Any C++ method on any arbitrary object can be called this way. The events are posted in a thread-safe way. Use this function to delay code at a place where is it safe for OSG: ex removing a scene graph branch. This code may not be safe in you own thread. Note: This is not a whole simulator, especially there is no notion of a deterministic simulated time. But the template way of posting events was "inspired" from a more complete simulator framework. See http://nicolas.brodu.free.fr/en/programmation/crogai/index.html for a project using this simulator. See parent "update" method too.
|
|
Post an event, scheduled to be executed at next frame update. Any C++ method on any arbitrary object can be called this way. The events are posted in a thread-safe way. Use this function to delay code at a place where is it safe for OSG: ex removing a scene graph branch. This code may not be safe in you own thread. Note: This is not a whole simulator, especially there is no notion of a deterministic simulated time. But the template way of posting events was "inspired" from a more complete simulator framework. See http://nicolas.brodu.free.fr/en/programmation/crogai/index.html for a project using this simulator. See parent "update" method too.
|
|
Post an event, scheduled to be executed at next frame update. Any C++ method on any arbitrary object can be called this way. The events are posted in a thread-safe way. Use this function to delay code at a place where is it safe for OSG: ex removing a scene graph branch. This code may not be safe in you own thread. Note: This is not a whole simulator, especially there is no notion of a deterministic simulated time. But the template way of posting events was "inspired" from a more complete simulator framework. See http://nicolas.brodu.free.fr/en/programmation/crogai/index.html for a project using this simulator. See parent "update" method too.
|
|
Post an event, scheduled to be executed at next frame update. Any C++ method on any arbitrary object can be called this way. The events are posted in a thread-safe way. Use this function to delay code at a place where is it safe for OSG: ex removing a scene graph branch. This code may not be safe in you own thread. Note: This is not a whole simulator, especially there is no notion of a deterministic simulated time. But the template way of posting events was "inspired" from a more complete simulator framework. See http://nicolas.brodu.free.fr/en/programmation/crogai/index.html for a project using this simulator. See parent "update" method too.
|
|
Post an event, scheduled to be executed at next frame update. Any C "void method(..)" with three arguments can be called this way. The events are posted in a thread-safe way. Use this function to delay code at a place where is it safe for OSG: ex removing a scene graph branch. This code may not be safe in you own thread. Note: This is not a whole simulator, especially there is no notion of a deterministic simulated time. But the template way of posting events was "inspired" from a more complete simulator framework. See http://nicolas.brodu.free.fr/en/programmation/crogai/index.html for a project using this simulator. See parent "update" method too.
|
|
Post an event, scheduled to be executed at next frame update. Any C "void method(..)" with two arguments can be called this way. The events are posted in a thread-safe way. Use this function to delay code at a place where is it safe for OSG: ex removing a scene graph branch. This code may not be safe in you own thread. Note: This is not a whole simulator, especially there is no notion of a deterministic simulated time. But the template way of posting events was "inspired" from a more complete simulator framework. See http://nicolas.brodu.free.fr/en/programmation/crogai/index.html for a project using this simulator. See parent "update" method too.
|
|
Post an event, scheduled to be executed at next frame update. Any C "void method(..)" with one argument can be called this way. The events are posted in a thread-safe way. Use this function to delay code at a place where is it safe for OSG: ex removing a scene graph branch. This code may not be safe in you own thread. Note: This is not a whole simulator, especially there is no notion of a deterministic simulated time. But the template way of posting events was "inspired" from a more complete simulator framework. See http://nicolas.brodu.free.fr/en/programmation/crogai/index.html for a project using this simulator. See parent "update" method too.
|
|
Post an event, scheduled to be executed at next frame update. Any C "void method()" can be called this way. The events are posted in a thread-safe way. Use this function to delay code at a place where is it safe for OSG: ex removing a scene graph branch. This code may not be safe in you own thread. Note: This is not a whole simulator, especially there is no notion of a deterministic simulated time. But the template way of posting events was "inspired" from a more complete simulator framework. See http://nicolas.brodu.free.fr/en/programmation/crogai/index.html for a project using this simulator. See parent "update" method too.
|
|
Post an event, scheduled to be executed at next frame update. The events are posted in a thread-safe way. Use this function to delay code at a place where is it safe for OSG: ex removing a scene graph branch. This code may not be safe in you own thread. Note: This is not a whole simulator, especially there is no notion of a deterministic simulated time. But the template way of posting events was "inspired" from a more complete simulator framework. See http://nicolas.brodu.free.fr/en/programmation/crogai/index.html for a project using this simulator. Note2: In this implementation, the dispatcher MUST have been allocated with new. This is the case with all templatized versions of post, but you've been warned if you use your own dispatcher. See parent "update" method too. |
|
Globally locks or unlocks the viewer. Guarantee that during a protected section, the scenegraph may be safely modified Also makes things deterministic, unlike posting an event to the next update => use event posts to next update when non-determinism isn't a problem (like changing a color, etc...) => use global lock when the order is very important (like a simulator step adding a new agent) |