#include <FsfNode.h>
Inherited by fsf::CBarrier, fsf::CCharBuffer, fsf::CPulse, and fsf::CTypeNodeBase.
Public Member Functions | |
Creators | |
CNode () | |
0-parameter constructor | |
CNode (CNode *pParent, Time tTime=0) | |
2-parameter constructor: pointer to parent and timestamp | |
CNode (const std::string &strName, CNode *pParent=NULL, Time tTime=0) | |
3-parameter constructor: name, pointer to parent and timestamp | |
CNode (const CNode &rhs) | |
Copy constructor. | |
virtual | ~CNode () |
Virtual destructor. | |
virtual CNode * | clone () const |
Cloning: necessary for run-time polymorphism. | |
Manipulators | |
CNode & | operator= (const CNode &rhs) |
Assignment operator. | |
void | setTime (Time tTime) |
Sets this node's sample timestamp. | |
void | setDuration (Time tDuration) |
Sets this node's sample duration. | |
void | setName (const std::string &strName) |
Sets this node's name string (thread safe). | |
void | setParent (CNode *pParent) |
Sets this node's parent pointer. | |
void | setDeleted () |
Marks this node as deleted. | |
void | setNoDelete (bool bNoDelete=true) |
Prevents this node from being marked for deletion. | |
virtual bool | deleteNode (bool bForce=false) |
Marks node and its components as deleted (recursive). | |
virtual void | addComponent (CNode *pNode) |
Adds argument node at the front of this node's list of components (subnodes). | |
virtual void | addComponent (CNode *pNode, int nMode, CNode *pReference=NULL) |
Adds argument node to this node's list of components (subnodes). | |
virtual bool | removeComponent (CNode *pNode) |
virtual void | cleanUpComponents (std::list< CNode * > &listNodes) |
Performs garbage collecting on components marked for deletion (recursive). | |
virtual void | generateChildrenList (std::list< CNode * > &listNode) |
Returns a list of pointers to subnodes. | |
virtual void | generateChildrenHandleList (std::list< CPassiveHandle * > &listHandles) |
Returns a list of passive handles to subnodes. | |
void | getName (std::string &strName) |
Gets this node's name string (thread safe) Should really be an accessor (const ). | |
virtual CPulse * | getPulse () |
Gets the root of the hierarchy of which this node is part. | |
Accessors | |
Gets a pointer to this node's parent | |
virtual void | getTypeID (std::string &str) const |
Gets this node's factory mapping key. | |
Time | getTime () const |
Gets this node's sample timestamp. | |
Time | getDuration () const |
Gets this node's sample duration. | |
CNode * | getParent () const |
bool | isNotDeleted () const |
Returns true if node is NOT deleted. | |
bool | canDelete () const |
Returns true if node can be deleted. | |
Filtering utility functions | |
std::string & | name () |
Returns a reference to this node's name string (no lock). | |
bool | testNameExact (const std::string &str) const |
Tests equality between argument string and this node's name. | |
bool | testNameWildcard (const std::string &str) const |
Tests compatibility between argument string (pattern) and this node's name. | |
void | incNbHandleRefs () |
Increments handle reference count (thread safe). | |
void | decNbHandleRefs () |
Decrements handle reference count (thread safe). | |
Protected Member Functions | |
std::list< CNode * > & | getListComponents () |
Gets a reference to the list of components Not thread safe, protected access function provided for derived classes. |
fsf::CNode::CNode | ( | ) | [inline] |
0-parameter constructor
2-parameter constructor: pointer to parent and timestamp
3-parameter constructor: name, pointer to parent and timestamp
fsf::CNode::CNode | ( | const CNode & | rhs | ) | [inline] |
Copy constructor.
CNode::~CNode | ( | ) | [virtual] |
Virtual destructor.
Destructor recursively destroys subnodes.
A node is not actually deleted until all its descendents are deleted (i.e. reference free)
Adds argument node to this node's list of components (subnodes).
If reference is found, mode: 0=insert before, 1=insert after If not, mode: 0=insert at head, 1=insert at tail.
virtual void fsf::CNode::addComponent | ( | CNode * | pNode | ) | [inline, virtual] |
Adds argument node at the front of this node's list of components (subnodes).
bool fsf::CNode::canDelete | ( | ) | const [inline] |
Returns true
if node can be deleted.
virtual void fsf::CNode::cleanUpComponents | ( | std::list< CNode * > & | listNodes | ) | [virtual] |
Performs garbage collecting on components marked for deletion (recursive).
virtual CNode* fsf::CNode::clone | ( | ) | const [inline, virtual] |
Cloning: necessary for run-time polymorphism.
Reimplemented in fsf::CBarrier, fsf::CCharBuffer, fsf::CTypeNodeBase, and fsf::CTypeNode< Type >.
void fsf::CNode::decNbHandleRefs | ( | ) | [inline] |
Decrements handle reference count (thread safe).
bool CNode::deleteNode | ( | bool | bForce = false |
) | [virtual] |
Marks node and its components as deleted (recursive).
Proceeds only if the node can be deleted or if the argument is true
.
Does not actually destroy any node; actual destruction must be done by garbage collecting process.
void CNode::generateChildrenHandleList | ( | std::list< CPassiveHandle * > & | listHandles | ) | [virtual] |
Returns a list of passive handles to subnodes.
Returns a list of handles to child nodes.
Handles must be destroyed after use in calling function.
void CNode::generateChildrenList | ( | std::list< CNode * > & | listNode | ) | [virtual] |
Returns a list of pointers to subnodes.
Time fsf::CNode::getDuration | ( | ) | const [inline] |
Gets this node's sample duration.
std::list<CNode*>& fsf::CNode::getListComponents | ( | ) | [inline, protected] |
Gets a reference to the list of components Not thread safe, protected access function provided for derived classes.
void fsf::CNode::getName | ( | std::string & | strName | ) | [inline] |
Gets this node's name string (thread safe) Should really be an accessor (const
).
CNode* fsf::CNode::getParent | ( | ) | const [inline] |
virtual CPulse* fsf::CNode::getPulse | ( | ) | [inline, virtual] |
Gets the root of the hierarchy of which this node is part.
This method recursively gets to the root of the pulse. Should really be an accessor (const
)
Reimplemented in fsf::CPulse.
Time fsf::CNode::getTime | ( | ) | const [inline] |
Gets this node's sample timestamp.
virtual void fsf::CNode::getTypeID | ( | std::string & | str | ) | const [inline, virtual] |
Gets this node's factory mapping key.
Does it make sense to have one for the base node???
Reimplemented in fsf::CBarrier, fsf::CCharBuffer, fsf::CTypeNodeBase, and fsf::CTypeNode< Type >.
void fsf::CNode::incNbHandleRefs | ( | ) | [inline] |
Increments handle reference count (thread safe).
bool fsf::CNode::isNotDeleted | ( | ) | const [inline] |
Returns true
if node is NOT deleted.
std::string& fsf::CNode::name | ( | ) | [inline] |
Returns a reference to this node's name string (no lock).
bool CNode::removeComponent | ( | CNode * | pNode | ) | [virtual] |
void fsf::CNode::setDeleted | ( | ) | [inline] |
Marks this node as deleted.
The node is not actually destroyed, but will not be considered in any operation other than garbage collection
void fsf::CNode::setDuration | ( | Time | tDuration | ) | [inline] |
Sets this node's sample duration.
void fsf::CNode::setName | ( | const std::string & | strName | ) | [inline] |
Sets this node's name string (thread safe).
void fsf::CNode::setNoDelete | ( | bool | bNoDelete = true |
) | [inline] |
Prevents this node from being marked for deletion.
void fsf::CNode::setParent | ( | CNode * | pParent | ) | [inline] |
Sets this node's parent pointer.
void fsf::CNode::setTime | ( | Time | tTime | ) | [inline] |
Sets this node's sample timestamp.
bool fsf::CNode::testNameExact | ( | const std::string & | str | ) | const [inline] |
Tests equality between argument string and this node's name.
bool fsf::CNode::testNameWildcard | ( | const std::string & | str | ) | const [inline] |
Tests compatibility between argument string (pattern) and this node's name.