OpenVideo Documentation

   Main Page       Modules       Class Hierarchy       Alphabetical List       Compound List       File List       Compound Members       Related Pages   

openvideo::Node Class Reference
[Core Classes]

The Node class implements the 'AbstractProduct' part from the 'AbstractFactory' pattern [POSA96]. More...

#include <Node.h>

Inherited by openvideo::DSVLSrc, openvideo::GL_TEXTURE_2D_Sink, openvideo::GLUTSink, openvideo::ImageSrc, openvideo::OpenCVSrc, openvideo::TestSrc, openvideo::V4L2Src, openvideo::VideoSink, openvideo::VideoSinkSubscriber, and openvideo::VideoWrapperSrc.

List of all members.

Public Member Functions

 Node ()
virtual ~Node ()
virtual void initPixelFormats ()=0
virtual bool validateCurrentPixelFormat ()
virtual const char * getName ()
virtual void init ()
virtual void start ()
virtual void stop ()
virtual void process ()
virtual void postProcess ()
virtual void preProcess ()
virtual bool setParameter (std::string key, std::string value)
openvideo::StategetState ()
void addOutput (openvideo::Node *output)
void addInput (openvideo::Node *output)
std::vector< openvideo::Node * > * getOutputs ()
std::vector< openvideo::Node * > * getInputs ()
int getInDegree ()
int getCurInDegree ()
void decCurInDegree ()
int getOutDegree ()
int getCurOutDegree ()
void decCurOutDegree ()
void resetCurInOutDegree ()
const char * getDefName ()
virtual const std::string & getTypeName () const

Protected Attributes

std::vector< openvideo::Node * > outputs
std::vector< openvideo::Node * > inputs
openvideo::Statestate
int curInDegree
int curOutDegree
std::string name
std::string typeName
std::string defName
std::vector< PIXEL_FORMATpixelFormats
PIXEL_FORMAT curPixelFormat


Detailed Description

The Node class implements the 'AbstractProduct' part from the 'AbstractFactory' pattern [POSA96].

None of the functions is pure virtual but a node implementation should at least override the traversal function (process) to actually implement some action for a specific node.

Definition at line 51 of file Node.h.


Constructor & Destructor Documentation

Node::Node  ) 
 

The Constructor.

Definition at line 39 of file Node.cxx.

References curInDegree, curOutDegree, curPixelFormat, openvideo::FORMAT_UNKNOWN, name, and state.

Node::~Node  )  [virtual]
 

The Destructor.

Definition at line 50 of file Node.cxx.

References state.


Member Function Documentation

void Node::addInput openvideo::Node output  ) 
 

Adds a new input node.

This function gets called during the contruction of the graph and usually doesn't need to be overriden.

Definition at line 155 of file Node.cxx.

References curInDegree.

Referenced by openvideo::Manager::buildSubGraph().

void Node::addOutput openvideo::Node output  ) 
 

Adds a new children(output) to the node.

This function gets called during the contruction of the graph and usually doesn't need to be overriden.

Definition at line 148 of file Node.cxx.

References curOutDegree, and outputs.

Referenced by openvideo::Manager::buildSubGraph().

void Node::decCurInDegree  ) 
 

Decreases the current numer of imputs.

Next to the total number of inputs, a node is able to keeps track of the current number of 'meet' inputs. This for example gets useful during the construction of a traversal order.

Definition at line 198 of file Node.cxx.

References curInDegree.

Referenced by openvideo::Manager::initTopologicalSortedTraversal().

void Node::decCurOutDegree  ) 
 

Decreases the current numer of outputs.

Next to the total number of outputs, a node is able to keeps track of the current number of 'updated' outputs. This for example gets useful during the construction of a traversal order.

Definition at line 192 of file Node.cxx.

References curOutDegree.

int Node::getCurInDegree  ) 
 

Returns the current number of parents(inputs).

Next to the total number of inputs, a node is able to keeps track of the current number of 'meet' inputs. This for example gets useful during the construction of a traversal order.

Definition at line 161 of file Node.cxx.

References curInDegree.

int Node::getCurOutDegree  ) 
 

Returns the current number of children(outputs).

Next to the total number of outputs, a node is able to keeps track of the current number of 'updated' outputs. This for example gets useful during the construction of a traversal order.

Definition at line 179 of file Node.cxx.

References curOutDegree.

const char * Node::getDefName  ) 
 

Return the nodes 'DEF' name.

Definition at line 131 of file Node.cxx.

References defName.

Referenced by openvideo::Manager::addNode().

int Node::getInDegree  ) 
 

Returns the total number of parents(inputs).

Definition at line 167 of file Node.cxx.

References inputs.

Referenced by openvideo::OpenCVSrc::init().

std::vector< Node * > * Node::getInputs  ) 
 

Returns a vector with all the input(parent) nodes.

Definition at line 143 of file Node.cxx.

References inputs.

const char * Node::getName  )  [virtual]
 

Definition at line 95 of file Node.cxx.

References name.

Referenced by openvideo::GLUTSink::mainLoop().

int Node::getOutDegree  ) 
 

Returns the total number of children(outputs).

*

Definition at line 173 of file Node.cxx.

References outputs.

std::vector< Node * > * Node::getOutputs  ) 
 

Returns a vector with all the output(children) nodes.

Definition at line 137 of file Node.cxx.

References outputs.

State * Node::getState  ) 
 

Returns the node's state;.

Definition at line 57 of file Node.cxx.

References state.

virtual const std::string& openvideo::Node::getTypeName  )  const [inline, virtual]
 

Definition at line 204 of file Node.h.

void Node::init  )  [virtual]
 

Is called once before the (process)traversal starts.

Init should be used to implement any initializations a specific node needs.

Reimplemented in openvideo::DSVLSrc, openvideo::GL_TEXTURE_2D_Sink, openvideo::GLUTSink, openvideo::ImageSrc, openvideo::OpenCVSrc, openvideo::TestSrc, openvideo::V4L2Src, openvideo::VideoSink, and openvideo::VideoWrapperSrc.

Definition at line 101 of file Node.cxx.

virtual void openvideo::Node::initPixelFormats  )  [pure virtual]
 

return value = the number of supported input formats.

the formats are stored in 'pixelFormats'.

Implemented in openvideo::DSVLSrc, openvideo::GL_TEXTURE_2D_Sink, openvideo::GLUTSink, openvideo::ImageSrc, openvideo::OpenCVSrc, openvideo::TestSrc, openvideo::V4L2Src, openvideo::VideoSink, openvideo::VideoWrapperSrc, and TestWinCE.

void Node::postProcess  )  [virtual]
 

This function is called after OpenVideo's graph is entirely traversed and before a new traversal is invoked.

Here, a specific node implementation can reset some data before a new traversal will take place.

Reimplemented in openvideo::DSVLSrc, openvideo::ImageSrc, openvideo::OpenCVSrc, openvideo::V4L2Src, openvideo::VideoSink, and openvideo::VideoWrapperSrc.

Definition at line 121 of file Node.cxx.

void Node::preProcess  )  [virtual]
 

This function is called after OpenVideo's graph is entirely traversed and before a new traversal is invoked.

Here, a specific node implementation can reset some data before a new traversal will take place.

Reimplemented in openvideo::DSVLSrc, openvideo::ImageSrc, and openvideo::VideoWrapperSrc.

Definition at line 126 of file Node.cxx.

void Node::process  )  [virtual]
 

This is the actual traversal fucntion.

Process is called whenever a new traversal is invoked by the managers timer. A specific node implementation should do all its computations which need to be updated here.

Reimplemented in openvideo::DSVLSrc, openvideo::GL_TEXTURE_2D_Sink, openvideo::GLUTSink, openvideo::ImageSrc, openvideo::OpenCVSrc, openvideo::TestSrc, openvideo::V4L2Src, openvideo::VideoSink, and openvideo::VideoWrapperSrc.

Definition at line 116 of file Node.cxx.

void Node::resetCurInOutDegree  ) 
 

Resets the current numer of outputs and inputs to the total numer of in- and outputs.

Definition at line 185 of file Node.cxx.

References curInDegree, curOutDegree, inputs, and outputs.

bool Node::setParameter std::string  key,
std::string  value
[virtual]
 

setParameter is called by OpenVideo's parser.

The function gets the xml (key)string and the corresponding value right out of the xml text file. A specific node implementation should override 'setParameter' to set all its parameters comming from the xml configuration.
Notice: Node::setParameter implements these for the keyword DEF and name. If you want your node to be able to get referenced via USE or to just 'have' a name xo should call Node::setParameter(key,value) in your node implementation.

Reimplemented in openvideo::DSVLSrc, openvideo::ImageSrc, openvideo::OpenCVSrc, openvideo::V4L2Src, and openvideo::VideoWrapperSrc.

Definition at line 63 of file Node.cxx.

References curPixelFormat, defName, name, and openvideo::PixelFormat::StringToFormat().

Referenced by openvideo::Manager::addNode(), openvideo::VideoWrapperSrc::setParameter(), openvideo::V4L2Src::setParameter(), openvideo::OpenCVSrc::setParameter(), openvideo::ImageSrc::setParameter(), and openvideo::DSVLSrc::setParameter().

void Node::start  )  [virtual]
 

Is called once before the (process)traversal starts.

Start should be used to implement any start routines a specific node needs.

Reimplemented in openvideo::GLUTSink, openvideo::OpenCVSrc, and openvideo::V4L2Src.

Definition at line 106 of file Node.cxx.

void Node::stop  )  [virtual]
 

Is called after the (process)traversal finishes.

Stop should be called to clean up any node specific data.

Reimplemented in openvideo::OpenCVSrc, and openvideo::V4L2Src.

Definition at line 111 of file Node.cxx.

bool Node::validateCurrentPixelFormat  )  [virtual]
 

Definition at line 83 of file Node.cxx.

References curPixelFormat, and pixelFormats.


Member Data Documentation

int openvideo::Node::curInDegree [protected]
 

Current input degree.

Next to the total number of inputs, a node is able to keeps track of the current number of 'meet' inputs. This for example gets useful during the construction of a traversal order.

Definition at line 228 of file Node.h.

Referenced by addInput(), decCurInDegree(), getCurInDegree(), Node(), and resetCurInOutDegree().

int openvideo::Node::curOutDegree [protected]
 

current output degree Next to the total number of outputs, a node is able to keeps track of the current number of 'updated' outputs.

This for example gets useful during the construction of a traversal order.

Definition at line 235 of file Node.h.

Referenced by addOutput(), decCurOutDegree(), getCurOutDegree(), Node(), and resetCurInOutDegree().

PIXEL_FORMAT openvideo::Node::curPixelFormat [protected]
 

Definition at line 256 of file Node.h.

Referenced by openvideo::ImageSrc::init(), openvideo::GLUTSink::init(), openvideo::GL_TEXTURE_2D_Sink::init(), openvideo::DSVLSrc::init(), Node(), setParameter(), and validateCurrentPixelFormat().

std::string openvideo::Node::defName [protected]
 

The node's 'DEF' name.

Definition at line 249 of file Node.h.

Referenced by getDefName(), and setParameter().

std::vector<openvideo::Node*> openvideo::Node::inputs [protected]
 

A vector to hold the children (inputs).

Definition at line 216 of file Node.h.

Referenced by getInDegree(), getInputs(), openvideo::VideoSink::init(), openvideo::GLUTSink::init(), openvideo::GL_TEXTURE_2D_Sink::init(), and resetCurInOutDegree().

std::string openvideo::Node::name [protected]
 

The node's name.

Definition at line 240 of file Node.h.

Referenced by openvideo::DSVLSrc::DSVLSrc(), getName(), openvideo::GL_TEXTURE_2D_Sink::GL_TEXTURE_2D_Sink(), openvideo::GLUTSink::GLUTSink(), openvideo::ImageSrc::ImageSrc(), openvideo::GLUTSink::init(), openvideo::GL_TEXTURE_2D_Sink::init(), Node(), setParameter(), openvideo::TestSrc::TestSrc(), openvideo::VideoSink::VideoSink(), and openvideo::VideoWrapperSrc::VideoWrapperSrc().

std::vector<openvideo::Node*> openvideo::Node::outputs [protected]
 

A vector to hold the children (outputs).

Definition at line 211 of file Node.h.

Referenced by addOutput(), getOutDegree(), getOutputs(), and resetCurInOutDegree().

std::vector<PIXEL_FORMAT> openvideo::Node::pixelFormats [protected]
 

The node's 'DEF' name.

Definition at line 254 of file Node.h.

Referenced by openvideo::VideoWrapperSrc::initPixelFormats(), openvideo::VideoSink::initPixelFormats(), openvideo::V4L2Src::initPixelFormats(), TestWinCE::initPixelFormats(), openvideo::TestSrc::initPixelFormats(), openvideo::OpenCVSrc::initPixelFormats(), openvideo::ImageSrc::initPixelFormats(), openvideo::GLUTSink::initPixelFormats(), openvideo::GL_TEXTURE_2D_Sink::initPixelFormats(), openvideo::DSVLSrc::initPixelFormats(), and validateCurrentPixelFormat().

openvideo::State* openvideo::Node::state [protected]
 

The State.

Default=NULL.

Definition at line 221 of file Node.h.

Referenced by getState(), openvideo::GLUTSink::GLUTSink(), openvideo::VideoWrapperSrc::init(), openvideo::VideoSink::init(), openvideo::V4L2Src::init(), openvideo::TestSrc::init(), openvideo::OpenCVSrc::init(), openvideo::ImageSrc::init(), openvideo::GLUTSink::init(), openvideo::GL_TEXTURE_2D_Sink::init(), openvideo::DSVLSrc::init(), Node(), openvideo::OpenCVSrc::postProcess(), openvideo::VideoWrapperSrc::process(), openvideo::VideoSink::process(), openvideo::TestSrc::process(), openvideo::OpenCVSrc::process(), openvideo::ImageSrc::process(), openvideo::GLUTSink::process(), openvideo::GL_TEXTURE_2D_Sink::process(), openvideo::DSVLSrc::process(), openvideo::V4L2Src::processImage(), openvideo::TestSrc::TestSrc(), TestWinCE::update(), openvideo::V4L2Src::V4L2Src(), openvideo::DSVLSrc::~DSVLSrc(), openvideo::ImageSrc::~ImageSrc(), ~Node(), openvideo::TestSrc::~TestSrc(), and openvideo::V4L2Src::~V4L2Src().

std::string openvideo::Node::typeName [protected]
 

The node's type name.

Definition at line 243 of file Node.h.

Referenced by openvideo::DSVLSrc::DSVLSrc(), openvideo::GL_TEXTURE_2D_Sink::GL_TEXTURE_2D_Sink(), openvideo::GLUTSink::GLUTSink(), openvideo::ImageSrc::ImageSrc(), openvideo::TestSrc::TestSrc(), openvideo::VideoSink::VideoSink(), and openvideo::VideoWrapperSrc::VideoWrapperSrc().


The documentation for this class was generated from the following files:
 This page was generated at Wed May 31 13:04:18 2006 for OpenVideo by Doxygen.
 If you have any comments, please send a message to schmalstieg@icg.tu-graz.ac.at.
www.studierstube.org