#include <Node.h>
Inheritance diagram for ot::Node:


Public Types | |
| typedef Cptr< Node > | Ptr |
| typedef std::vector< Ptr > | NodeVector |
| enum | error { OK = 0, GRAPH_CONSTRAINT, READONLY, CONTEXT_ERROR, NOT_FOUND } |
| error type returned by some graph manipulation functions More... | |
Public Member Functions | |
| Node () | |
| virtual | ~Node () |
| const std::string & | getType () const |
| const std::string & | getName () const |
| void | setName (const std::string &name_) |
| Context * | getContext () const |
| virtual int | isNodePort () |
| Node * | findNode (const std::string &key, const std::string &val) |
| void | addParent (Node *parent) |
| unsigned int | countAllChildren () |
| Node * | getAnyChild (unsigned int index) |
| StringTable & | getAttributes () |
Attributes Control Interface | |
This set of methods allows to manipulate the attributes of a node in a safe and abstract manner. These methods operate on the attributes of the underlying XML element. Whenever an attribute changes the implementation of the node should take care to update the XML elements attributes as well. | |
| const std::string | get (const std::string &key) const |
| int | get (const std::string &key, int *value, int len=1) |
| int | get (const std::string &key, float *value, int len=1) |
| int | get (const std::string &key, double *value, int len=1) |
| void | put (const std::string &key, const std::string &value) |
| void | remove (const std::string &key) |
| void | put (const std::string &key, const int value) |
| void | put (const std::string &key, const float value) |
| void | put (const std::string &key, const double value) |
| void | put (const std::string &key, const int *value, int len) |
| void | put (const std::string &key, const float *value, int len) |
| void | put (const std::string &key, const double *value, int len) |
Graph Navigation Interface | |
This set of methods allows to manipulate the data flow graph in a rather safe manner. | |
| Node * | getParent () |
| Node * | getParent (unsigned int index) |
| unsigned int | countParents () |
| unsigned int | countChildren () |
| Node * | getChild (unsigned int index) |
| error | addChild (Node &child) |
| error | removeChild (Node &child) |
| unsigned int | countPorts () |
| NodePort * | getPort (const std::string &name, unsigned int index=0) |
| NodePort * | getPort (unsigned int index) |
| error | addPort (const std::string &name) |
| error | removePort (const std::string &name) |
| error | removePort (NodePort &port) |
| error | removePort (unsigned int index) |
EventGenerator & EventObserver Interface | |
This is the classic event passing interface, working from children nodes up to parent nodes. A child node creates a new event and its parent node is automatically notified of the event. The type of an event is of class Event. | |
| virtual int | isEventGenerator () |
| virtual void | onEventGenerated (Event &event, Node &generator) |
| void | updateObservers (Event &data) |
EventQueue Interface | |
The EventQueue interface allows access to a queue of events, ordered by their timestamps, with the latest event coming first, at slot 0. This works from parents to children, i.e. parents query their children for a certain event in the queue. | |
| virtual int | isEventQueue () |
| virtual Event & | getEvent (unsigned int index=0) |
| virtual Event & | getEventNearTime (double time) |
| virtual unsigned int | getSize () |
TimeDependend Interface | |
The TimeDependend Interface allows access to a continous function of events in time. It also works from parents to children, i.e. a parent queries a child for the event at a given point in time. | |
| virtual int | isTimeDependend () |
| virtual Event & | getEventAtTime (double time) |
Public Attributes | |
| OT_DECLARE_IREFCOUNTED | |
Protected Attributes | |
| NodeVector | parents |
| NodeVector | children |
| StringTable | attributes |
| std::string | name |
| the unique ID given in the XML configuration file. | |
| std::string | type |
| the type of the node, equals the name of the configuration element | |
Friends | |
| class | Context |
|
|
a Vector of Node pointers. Very useful to implement a simple container of Nodes such as a parent node, or to keep pointers to several nodes around. |
|
|
|
|
|
error type returned by some graph manipulation functions
|
|
|
empty basic constructor. The constructors of any nodes should be protected to avoid application code to directly construct new instances. Any new nodes should be generated via valid API calls such as Context::createNode() to ensure that internal data is correct. Any NodeFactories needing access should be declared friend classes of the nodes. |
|
|
basic destructor. |
|
|
adds a new child to the direct children of the node. This method will only work, if it does not violate any rules for the graph.
|
|
|
|
|
|
creates and adds a new child NodePort object of the given name. It will also only work, if it does not violate any rules for the graph.
|
|
|
returns the total number of direct children. Without regards to whether they are nodeports or not. Meaning it counts ALL children
|
|
|
returns the number of children that are not wrapped, nor wrapper nodes. That is the direct children a node may work with.
Reimplemented in ot::ConfigNode. |
|
|
returns the number of parents of this node
|
|
|
returns the number of NodePorts present on this Node. This is the number of NodePorts actually used, not the total number possible by the content definition.
|
|
||||||||||||
|
Searches the tree rooted in this node for a node containing an attribute named key with the value val.
|
|
||||||||||||||||
|
parses a stored entry into an array of doubles. It assumes that the doubles are separated by spaces. It returns the number of actually converted doubles.
|
|
||||||||||||||||
|
parses a stored entry into an array of floats. It assumes that the floats are separated by spaces. It returns the number of actually converted floats.
|
|
||||||||||||||||
|
parses a stored entry into an array of integers. It assumes that the integers are separated by spaces. It returns the number of actually converted integers.
|
|
|
returns a value stored in the map
|
|
|
returns a child at index, no matter whether it is a wrapper or not. Meaning it could return a nodeport.
|
|
|
Reimplemented in ot::ConfigNode. |
|
|
returns a child indicated by the index. This only returns children that are not wrapped or Wrapper nodes themselves.
Reimplemented in ot::ConfigNode. |
|
|
returns a pointer to the Context this node lives in.
|
|
|
returns a stored event by index. The index starts with 0 for the latest event and goes back in time with increasing index.
Reimplemented in ot::EventQueueNode, and ot::Transformation. |
|
|
returns the event of the time dependend function at a given point in time.
Reimplemented in ot::Transformation. |
|
|
returns the event closest to a given point in time.
Reimplemented in ot::EventQueueNode, and ot::Transformation. |
|
|
returns the value of a unique ID set on the node. If no ID is set, this method returns an empty string
|
|
|
returns a parent indicated by the index.
|
|
|
returns a pointer to the parent node of the current node. This can be a wrapper node to mark a certain input port of a real node. In this case, getting the wrapper node's parent will yield the true parent. The root node will return NULL, because it has no parent.
|
|
|
returns a NodePort child object by index. The order of the NodePorts is not fixed but may depend on the configuration file used.
|
|
||||||||||||
|
returns a NodePort child object indexed by Name. If the NodePort is not present, NULL is returned.
|
|
|
returns the number of stored events.
Reimplemented in ot::EventQueueNode, and ot::Transformation. |
|
|
returns the type of the node, that is the element name of the underlying configuration element. An implementation can then use this information to down cast a node reference or pointer to the correct class.
|
|
|
|
tests for EventQueue interface being present. This has to be overriden in classes that subclass EventQueue. See isEventGenerator for details.
Reimplemented in ot::EventQueueNode, and ot::Transformation. |
|
|
tests whether the node is a wrapper node. This method is only there to distinguish wrapper nodes from other nodes.
Reimplemented in ot::Override, and ot::NodePort. |
|
|
tests for TimeDependend interface being present. This has to be overriden in classes that subclass TimeDependend. See isEventGenerator for details.
Reimplemented in ot::Transformation. |
|
||||||||||||
|
||||||||||||||||
|
sets an array of double values. It is converted to a string where the values are separated by spaces and stored under the given key.
|
|
||||||||||||||||
|
sets an array of float values. It is converted to a string where the values are separated by spaces and stored under the given key.
|
|
||||||||||||||||
|
sets an array of int values. It is converted to a string where the values are separated by spaces and stored under the given key.
|
|
||||||||||||
|
sets a double value, the value is converted to a string and stored under the given key.
|
|
||||||||||||
|
sets a float value, the value is converted to a string and stored under the given key.
|
|
||||||||||||
|
sets an int value, the value is converted to a string and stored under the given key.
|
|
||||||||||||
|
stores a key value pair in the table, overwritting a possible prior value
|
|
|
removes a key value pair from the table
|
|
|
removes a child from the direct children of a node. This method will only work, if the passed node is actually a child of the node.
|
|
|
|
|
|
|
|
|
removes a child NodePort object. Again similar to removeChild(), but for NodePorts. This method will only work, if a NodePort of the passed name is present on the node.
|
|
|
|
|
|
Updates the parent node and any reference nodes whenever a new event is generated by the Event interface. This method should be used to propagate new events, as it implements correctly the event behaviour.
Reimplemented in ot::CallforwardNode. |
|
|
|
|
|
|
|
|
|
|
|
the unique ID given in the XML configuration file. A Vector of pointers to reference nodes referencing this node. NodeVector references; Reimplemented in ot::CallbackNode, ot::CallforwardNode, ot::EventUtilityNode, and ot::ICubeXSource. |
|
|
|
|
|
Pointer to the parent XML element. |
|
|
the type of the node, equals the name of the configuration element
Reimplemented in ot::ConfidenceFilterNode, ot::ConfidenceSelectNode, ot::EventUtilityNode, and ot::FilterNode. |
1.4.6