openvideo::Manager Class Reference
[Core Classes]
The ‘Manager’ class represents OpenVideo's main object which constructs, holds and updates OpenVideo’s runtime data structure.
More...
#include <Manager.h>
Public Member Functions | |
| ~Manager () | |
| void | addNodeFactory (openvideo::NodeFactory *aFactory) |
| void | parseConfiguration (TiXmlElement *element) |
| bool | parseConfiguration (const std::string &filename) |
| void | buildSubGraph (TiXmlElement *parentElement, openvideo::Node *parentNode) |
| void | initTraversal () |
| void | run () |
| openvideo::Node * | addNode (TiXmlElement *element) |
| openvideo::Node * | getNode (std::string nodeName) |
| void | setGLContext (HGLRC _glContext, HDC _dc) |
| void | setGLContext (GLXDrawable _drawable, GLXContext _glContext, Display *_dsp) |
| void | deleteGLContext () |
| void | stop () |
| void | setTravFunction (void(*travFunction)(void *), void *data) |
| void | setInitTravFunction (void(*initTravFunction)(void *), void *data) |
| bool | isStarted () |
| Logger * | getLogger () |
Static Public Member Functions | |
| static Manager * | getInstance () |
| static void | update (void *) |
Public Attributes | |
| bool | glContextChanged |
Static Public Attributes | |
| static bool | hasGLContext = false |
Protected Member Functions | |
| Manager () | |
| void | initNodeFactories () |
| void | pause () |
| void | doIdleTasks () |
| void | resume () |
Static Protected Member Functions | |
| static void | topologicalSortedTraversal (void *nodeList) |
| static void | initTopologicalSortedTraversal (void *nodeList) |
| static void * | startUserInterface (void *) |
Protected Attributes | |
| openvideo::Scheduler * | scheduler |
| bool | isOVStarted |
| std::vector< openvideo::Node * > | nodes |
| std::vector< openvideo::Node * > | defNodes |
| std::vector< openvideo::NodeFactory * > | factories |
| Logger * | logger |
| bool | isRunning |
| bool | hasParsed |
| bool | updating |
| void * | controlThreadHandle |
| ACE_Thread_Mutex * | updateLock |
| ACE_Condition_Thread_Mutex * | updateLockCondition |
| bool | idleSetGLContext |
| bool | idleDeleteGLContext |
| GLXDrawable | dc |
| Display * | dsp |
| GLXContext | glContext |
| HGLRC | glContext |
| HDC | dc |
Static Protected Attributes | |
| static Manager * | instance = NULL |
| static void(* | initTraversalFunc )(void *data) = NULL |
| static void(* | traversalFunc )(void *data) = NULL |
| static void * | traversalData = NULL |
| static void * | initTraversalData = NULL |
| static bool | travBlock = false |
| static bool | isUserInterfaceRunning = false |
Detailed Description
The ‘Manager’ class represents OpenVideo's main object which constructs, holds and updates OpenVideo’s runtime data structure.
OpenVideo defines its data structure as a directed acyclic graph which is defined in an xml based configuration file. To construct such an OpenVideo graph the ‘Manager’ provides the necessary functionality to parse a given OpenVideo configuration as well as to construct the graph out of the information gained in the parsing step. To construct a single node the ‘Manager’ uses the related factory this specific node implements. Therefore, a list of factories of all known OpenVideo nodes is stored in an instance of a ‘Manager’.
The basic lifecycle of a Manager object looks like this:
//1) //1a) initialize the list of node factories //1b) set the callback function to update the graph //1c) set the function which initializes the graph // Manager manager; //2) //2a) parse the give configuration //2b) construct on OpenVideo graph manager.parseConfiguration(“aConfiguration”); //3) //3a) initialize the graph (by calling the function defined in (1b) –> this // perhaps rearranges the node list the manager holds) // the list //3b) initialize a timer to permanently update the graph data //3c) start the timer which constantly calls the traversal function which was // defined in 1b) manager.run()
The following drawing shows an example of an OpenVideo graph.
Internal dependencies -> * Timer -> to create the timer to trigger the traversal
* NodeFactory + Various Node Factories -> to create the nodes
* Node -> basic elements in the graph
External dependencies -> * TinyXML – to parse OpenVideo’s xml based configuration
Definition at line 104 of file Manager.h.
Constructor & Destructor Documentation
|
|
destructor
Definition at line 132 of file Manager.cxx. |
|
|
constructor
Definition at line 108 of file Manager.cxx. References dsp, glContext, glContextChanged, hasParsed, idleDeleteGLContext, idleSetGLContext, initNodeFactories(), initTopologicalSortedTraversal(), isRunning, logger, nodes, scheduler, setInitTravFunction(), setTravFunction(), topologicalSortedTraversal(), updateLock, updateLockCondition, and updating. Referenced by getInstance(). |
Member Function Documentation
|
|
Creates and configures a node by a given (tinyxml)Element. Before the created node is returned, the node will be added to the managers list of nodes. Notice: The connections between all nodes are set in 'buildSubGraph(void * parentElement, Node* parentNode)'. Definition at line 300 of file Manager.cxx. References openvideo::NodeFactory::createNode(), defNodes, factories, openvideo::Node::getDefName(), getNodeTypeId(), openvideo::LoggerBase::logEx(), logger, nodes, and openvideo::Node::setParameter(). Referenced by buildSubGraph(), and parseConfiguration(). |
|
|
adds a NodeFactory to the list of known factories'
Definition at line 595 of file Manager.cxx. References factories. |
|
||||||||||||
|
Constructs the sub graph for a given (tinyxml)Element. It adds all child nodes to 'parentNode' Definition at line 284 of file Manager.cxx. References openvideo::Node::addInput(), addNode(), and openvideo::Node::addOutput(). Referenced by parseConfiguration(). |
|
|
Definition at line 253 of file Manager.cxx. References idleDeleteGLContext, and pause(). |
|
|
Definition at line 165 of file Manager.cxx. References dc, dsp, glContext, glContextChanged, hasGLContext, idleDeleteGLContext, idleSetGLContext, openvideo::LoggerBase::logEx(), logger, and resume(). |
|
|
|
|
|
|
Returns the node with the given 'nodeName'. NULL is returned if non of those currently exist. Definition at line 603 of file Manager.cxx. References nodes. Referenced by TestWinCE::OnInitialize(). |
|
|
Initializes all factories. Adds all known (hard coded) factories to the manager's list of node factories' Definition at line 619 of file Manager.cxx. References factories, and SpectecSrcFactory(). Referenced by Manager(). |
|
|
An implementation of a topological sorted traversal strategy. This is used as the default traversal strategy OpenVideo implements. Definition at line 526 of file Manager.cxx. References openvideo::Node::decCurInDegree(), and nodes. Referenced by Manager(). |
|
|
Definition at line 510 of file Manager.cxx. References initTraversalData, openvideo::LoggerBase::logEx(), logger, and nodes. Referenced by main(). |
|
|
Definition at line 267 of file Manager.cxx. References isRunning. |
|
|
This method parses an xml configuartion of OpenVideo. While parsing the file the OpenVideo graph will be created. Definition at line 375 of file Manager.cxx. References addNode(), buildSubGraph(), hasParsed, openvideo::LoggerBase::logEx(), logger, and parseConfiguration(). |
|
|
Definition at line 368 of file Manager.cxx. References openvideo::SchedulerBase::parseConfiguration(), and scheduler. Referenced by main(), TestWinCE::OnInitialize(), and parseConfiguration(). |
|
|
Pauses the manger's mainLoop.
Definition at line 216 of file Manager.cxx. References isRunning, updateLock, and updateLockCondition. Referenced by deleteGLContext(), and setGLContext(). |
|
|
Definition at line 259 of file Manager.cxx. References isRunning, and updateLock. Referenced by doIdleTasks(). |
|
|
Starts the manger's mainLoop. Before it actually activates the timer -who is resposible for calling the update function- the traversal data is initialized and the graph is 'started' by calling 'initTraversalFunc(...)'. Definition at line 420 of file Manager.cxx. References controlThreadHandle, openvideo::SchedulerBase::init(), openvideo::SchedulerBase::run(), scheduler, and startUserInterface(). Referenced by main(), ManagerThreadFunc(), and TestWinCE::OnInitialize(). |
|
||||||||||||||||
|
Definition at line 242 of file Manager.cxx. |
|
||||||||||||
|
Definition at line 230 of file Manager.cxx. References dc, glContext, idleSetGLContext, and pause(). |
|
||||||||||||
|
Sets the function and data to be called before the actual traversal begins.
Definition at line 413 of file Manager.cxx. References initTraversalData, and initTraversalFunc. Referenced by Manager(). |
|
||||||||||||
|
Sets the manager's traversal function and data.
"setTravFunction(..)" is called during construction time with Manager::topologicalSortedTraversal as argument to set the default traversal strategy. Definition at line 406 of file Manager.cxx. References traversalData, and traversalFunc. Referenced by Manager(). |
|
|
Definition at line 443 of file Manager.cxx. References getInstance(), and isUserInterfaceRunning. Referenced by run(). |
|
|
Stops the manger's mainLoop.
Definition at line 498 of file Manager.cxx. References openvideo::LoggerBase::logEx(), logger, nodes, scheduler, and openvideo::SchedulerBase::stop(). |
|
|
Implementation of a topological sorted graph traversal. -- this is the default traversal of OpenVideo. Definition at line 569 of file Manager.cxx. References nodes, and travBlock. Referenced by Manager(). |
|
|
Definition at line 146 of file Manager.cxx. References getInstance(), and traversalData. Referenced by pollLoop(), openvideo::SchedulerPC::scheduleIdle(), and openvideo::SchedulerPC::scheduleTimer(). |
Member Data Documentation
|
|
Definition at line 276 of file Manager.h. Referenced by run(). |
|
|
|
|
|
Definition at line 300 of file Manager.h. Referenced by doIdleTasks(), and setGLContext(). |
|
|
A vector to hold all 'DEF' marked nodes in the xml file. This list holds references to nodes which are previously marked for later referencing. Definition at line 220 of file Manager.h. Referenced by addNode(). |
|
|
Definition at line 301 of file Manager.h. Referenced by doIdleTasks(), Manager(), and setGLContext(). |
|
|
A vector which holds objects of all known node factories. This vector will be searched when a new node is going to be created. Definition at line 226 of file Manager.h. Referenced by addNode(), addNodeFactory(), and initNodeFactories(). |
|
|
|
|
|
Definition at line 302 of file Manager.h. Referenced by doIdleTasks(), Manager(), and setGLContext(). |
|
|
Definition at line 190 of file Manager.h. Referenced by doIdleTasks(), and Manager(). |
|
|
Definition at line 104 of file Manager.cxx. Referenced by doIdleTasks(), and openvideo::GL_TEXTURE_2D_Sink::process(). |
|
|
Definition at line 272 of file Manager.h. Referenced by Manager(), and parseConfiguration(). |
|
|
Definition at line 295 of file Manager.h. Referenced by deleteGLContext(), doIdleTasks(), and Manager(). |
|
|
Definition at line 294 of file Manager.h. Referenced by doIdleTasks(), Manager(), and setGLContext(). |
|
|
A pointer to the traversal data Per default, this points to the managers list of nodes. It's value is overriden by setInitTravFunction(...); Definition at line 102 of file Manager.cxx. Referenced by initTraversal(), and setInitTravFunction(). |
|
|
A pointer to the function which initializes the traversal data.
Definition at line 100 of file Manager.cxx. Referenced by setInitTravFunction(). |
|
|
Definition at line 105 of file Manager.cxx. |
|
|
|
|
|
Definition at line 270 of file Manager.h. Referenced by isStarted(), Manager(), pause(), and resume(). |
|
|
Definition at line 106 of file Manager.cxx. Referenced by startUserInterface(). |
|
|
Definition at line 268 of file Manager.h. Referenced by addNode(), doIdleTasks(), initTraversal(), Manager(), parseConfiguration(), stop(), and ~Manager(). |
|
|
THE GRAPH. This vector holds all nodes in the current OpenVideo graph in a list. Definition at line 214 of file Manager.h. Referenced by addNode(), getNode(), initTopologicalSortedTraversal(), initTraversal(), Manager(), stop(), topologicalSortedTraversal(), and ~Manager(). |
|
|
Definition at line 200 of file Manager.h. Referenced by Manager(), parseConfiguration(), run(), stop(), and ~Manager(). |
|
|
A Mutex to block the invocation of a new traversal before the current traversal finishes.
Definition at line 103 of file Manager.cxx. Referenced by topologicalSortedTraversal(). |
|
|
The traversal data. This void pointer is passed to the traversal function every time it is going to be invoked. Per default, this points to the managers list of nodes. It's value is overriden by setTravFunction(...); Definition at line 101 of file Manager.cxx. Referenced by setTravFunction(), and update(). |
|
|
A pointer to the traversal function which is called by the run function.
Definition at line 99 of file Manager.cxx. Referenced by setTravFunction(). |
|
|
Mutex used in updateLockCond .
|
|
|
A condition variable which waits for an update to updateLock.
|
|
|
Definition at line 274 of file Manager.h. Referenced by Manager(). |
The documentation for this class was generated from the following files:
