Biorithm  1.1
Public Member Functions | Protected Attributes | Friends
DAGNode< NodeInfo > Class Template Reference

An object that represents a node in a Directed Acyclic Graph (DAG). NodeInfo is a class that can store extra information for each node. More...

#include <dag.h>

List of all members.

Public Member Functions

 DAGNode ()
 DAGNode (const NodeInfo &info)
 DAGNode (const DAGNode &rhs)
virtual void addChild (DAGNode< NodeInfo > *child, unsigned int type=0)
virtual void addParent (DAGNode< NodeInfo > *parent, unsigned int type=0)
virtual set< DAGNode< NodeInfo > * > getParents (unsigned int type=0)
virtual unsigned int getParentEdgeType (DAGNode< NodeInfo > *parent)
set< DAGNode< NodeInfo > * > getChildren (unsigned int type=0)
virtual set< DAGNode< NodeInfo > * > getAncestors (int type=0)
virtual set< DAGNode< NodeInfo > * > getDescendants (int type=0)
virtual NodeInfo getNodeInfo () const
 Return the NodeInfo stored with the DAGNode.
virtual NodeInfo & getNodeInfo ()
 Return a reference to the NodeInfo stored with the DAGNode.
virtual bool isChild (DAGNode< NodeInfo > *node, unsigned int type=0)
virtual bool isParent (DAGNode< NodeInfo > *node, unsigned int type=0)
 DAGNode ()
 DAGNode (const NodeInfo &info)
 DAGNode (const DAGNode &rhs)
virtual void addChild (DAGNode< NodeInfo > *child, unsigned int type=0)
virtual void addParent (DAGNode< NodeInfo > *parent, unsigned int type=0)
virtual set< DAGNode< NodeInfo > * > getParents (unsigned int type=0)
virtual unsigned int getParentEdgeType (DAGNode< NodeInfo > *parent)
set< DAGNode< NodeInfo > * > getChildren (unsigned int type=0)
virtual set< DAGNode< NodeInfo > * > getAncestors (int type=0)
virtual set< DAGNode< NodeInfo > * > getDescendants (int type=0)
virtual NodeInfo getNodeInfo () const
 Return the NodeInfo stored with the DAGNode.
virtual NodeInfo & getNodeInfo ()
 Return a reference to the NodeInfo stored with the DAGNode.
virtual bool isChild (DAGNode< NodeInfo > *node, unsigned int type=0)
virtual bool isParent (DAGNode< NodeInfo > *node, unsigned int type=0)

Protected Attributes

set< DAGNode< NodeInfo > * > parents [3]
set< DAGNode< NodeInfo > * > ancestors [3]
set< DAGNode< NodeInfo > * > children [3]
set< DAGNode< NodeInfo > * > descendants [3]

Friends

class DAG< DAGNode< NodeInfo > >

Detailed Description

template<typename NodeInfo>
class DAGNode< NodeInfo >

An object that represents a node in a Directed Acyclic Graph (DAG). NodeInfo is a class that can store extra information for each node.


Constructor & Destructor Documentation

template<typename NodeInfo>
DAGNode< NodeInfo >::DAGNode ( ) [inline]

Constructor.

template<typename NodeInfo>
DAGNode< NodeInfo >::DAGNode ( const DAGNode< NodeInfo > &  rhs) [inline]

Copy constructor.

Note:
The constructor only copies the NodeInfo stored with rhs. It does not copy the parents, children, ancestors, or descendants.
template<typename NodeInfo>
DAGNode< NodeInfo >::DAGNode ( ) [inline]

Constructor.

template<typename NodeInfo>
DAGNode< NodeInfo >::DAGNode ( const DAGNode< NodeInfo > &  rhs) [inline]

Copy constructor.

Note:
The constructor only copies the NodeInfo stored with rhs. It does not copy the parents, children, ancestors, or descendants.

Member Function Documentation

template<typename NodeInfo>
virtual unsigned int DAGNode< NodeInfo >::getParentEdgeType ( DAGNode< NodeInfo > *  parent) [inline, virtual]

Return the type of the edge between the node and the parent.

Warning:
The method assumes that parent is indeeed a parent of the node.
template<typename NodeInfo>
virtual unsigned int DAGNode< NodeInfo >::getParentEdgeType ( DAGNode< NodeInfo > *  parent) [inline, virtual]

Return the type of the edge between the node and the parent.

Warning:
The method assumes that parent is indeeed a parent of the node.
template<typename NodeInfo>
virtual bool DAGNode< NodeInfo >::isChild ( DAGNode< NodeInfo > *  node,
unsigned int  type = 0 
) [inline, virtual]

Returns true if and only if node is a child of the invocant.

node, a pointer to an instance of DAGNode< NodeInfo >.

template<typename NodeInfo>
virtual bool DAGNode< NodeInfo >::isChild ( DAGNode< NodeInfo > *  node,
unsigned int  type = 0 
) [inline, virtual]

Returns true if and only if node is a child of the invocant.

node, a pointer to an instance of DAGNode< NodeInfo >.

template<typename NodeInfo>
virtual bool DAGNode< NodeInfo >::isParent ( DAGNode< NodeInfo > *  node,
unsigned int  type = 0 
) [inline, virtual]

Returns true if and only if node is a parent of the invocant.

node, a pointer to an instance of DAGNode< NodeInfo >.

template<typename NodeInfo>
virtual bool DAGNode< NodeInfo >::isParent ( DAGNode< NodeInfo > *  node,
unsigned int  type = 0 
) [inline, virtual]

Returns true if and only if node is a parent of the invocant.

node, a pointer to an instance of DAGNode< NodeInfo >.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Friends