orxonox::ClassTreeMaskNode Class Reference

The ClassTreeMaskNode is a node in the internal tree of the ClassTreeMask, containing the rules of the mask. More...

#include <src/core/ClassTreeMask.h>

List of all members.

Public Member Functions

void addSubnode (ClassTreeMaskNode *subnode)
 Adds a new subnode to the list of subnodes.
 ClassTreeMaskNode (const Identifier *subclass, bool bIncluded=true)
 Constructor: Creates the node, sets the subclass and the rule.
void exclude (bool overwrite=true)
 Sets the rule for the node to "excluded".
const IdentifiergetClass () const
 Returns the Identifier of the class the rule refers to.
bool hasSubnodes () const
 Returns true if the Node has some subnodes.
void include (bool overwrite=true)
 Sets the rule for the node to "included".
bool isExcluded () const
 Tells if the rule is "excluded" or not.
bool isIncluded () const
 Tells if the rule is "included" or not.
void setIncluded (bool bIncluded, bool overwrite=true)
 Sets the rule for the node to a given value and erases all following rules.
 ~ClassTreeMaskNode ()
 Destructor: Deletes all subnodes.

Private Member Functions

void deleteAllSubnodes ()
 Deletes all subnodes of this node.

Private Attributes

bool bIncluded_
 The rule: included or excluded.
const Identifiersubclass_
 The Identifier of the subclass the rule refers to.
std::list< ClassTreeMaskNode * > subnodes_
 A list containing all subnodes in the tree.

Friends

class ClassTreeMask
class ClassTreeMaskIterator
class ClassTreeMaskObjectIterator


Detailed Description

The ClassTreeMaskNode is a node in the internal tree of the ClassTreeMask, containing the rules of the mask.

The ClassTreeMaskNode is used to store the rule (included or excluded) for a given class (described by the corresponding Identifier). The nodes are used in the internal tree of ClassTreeMask. To build a tree, they store a list of all subnodes.


Constructor & Destructor Documentation

orxonox::ClassTreeMaskNode::ClassTreeMaskNode ( const Identifier subclass,
bool  bIncluded = true 
)

Constructor: Creates the node, sets the subclass and the rule.

Parameters:
subclass The subclass the rule refers to
bIncluded The rule: included (true) or excluded (false)

References bIncluded_, and subclass_.

orxonox::ClassTreeMaskNode::~ClassTreeMaskNode (  ) 

Destructor: Deletes all subnodes.

References deleteAllSubnodes().


Member Function Documentation

void orxonox::ClassTreeMaskNode::addSubnode ( ClassTreeMaskNode subnode  ) 

Adds a new subnode to the list of subnodes.

Parameters:
subnode The new subnode

References subnodes_.

Referenced by orxonox::ClassTreeMask::add().

void orxonox::ClassTreeMaskNode::deleteAllSubnodes (  )  [private]

Deletes all subnodes of this node.

References subnodes_.

Referenced by setIncluded(), and ~ClassTreeMaskNode().

void orxonox::ClassTreeMaskNode::exclude ( bool  overwrite = true  ) 

Sets the rule for the node to "excluded".

Parameters:
overwrite True = overwrite previously added rules for inheriting classes

References setIncluded().

const Identifier* orxonox::ClassTreeMaskNode::getClass (  )  const [inline]

Returns the Identifier of the class the rule refers to.

Returns:
The Identifier representing the class

Referenced by orxonox::ClassTreeMask::add(), orxonox::ClassTreeMaskObjectIterator::create(), and orxonox::ClassTreeMask::isIncluded().

bool orxonox::ClassTreeMaskNode::hasSubnodes (  )  const [inline]

Returns true if the Node has some subnodes.

Referenced by orxonox::ClassTreeMaskObjectIterator::create().

void orxonox::ClassTreeMaskNode::include ( bool  overwrite = true  ) 

Sets the rule for the node to "included".

Parameters:
overwrite True = overwrite previously added rules for inheriting classes

References setIncluded().

bool orxonox::ClassTreeMaskNode::isExcluded (  )  const [inline]

Tells if the rule is "excluded" or not.

Returns:
The inverted rule: true = excluded, false = included

bool orxonox::ClassTreeMaskNode::isIncluded (  )  const [inline]

Tells if the rule is "included" or not.

Returns:
The rule: true = included, false = excluded

Referenced by orxonox::ClassTreeMask::clean(), orxonox::ClassTreeMaskObjectIterator::create(), and orxonox::ClassTreeMask::isIncluded().

void orxonox::ClassTreeMaskNode::setIncluded ( bool  bIncluded,
bool  overwrite = true 
)

Sets the rule for the node to a given value and erases all following rules.

Parameters:
bIncluded The rule: included (true) or excluded (false)
overwrite True = overwrite previously added rules for inheriting classes

References bIncluded_, and deleteAllSubnodes().

Referenced by orxonox::ClassTreeMask::add(), exclude(), and include().


Friends And Related Function Documentation

friend class ClassTreeMask [friend]

friend class ClassTreeMaskIterator [friend]

friend class ClassTreeMaskObjectIterator [friend]


Member Data Documentation

The rule: included or excluded.

Referenced by ClassTreeMaskNode(), and setIncluded().

The Identifier of the subclass the rule refers to.

Referenced by ClassTreeMaskNode().


The documentation for this class was generated from the following files:

Generated on Tue Jul 28 16:22:23 2009 for Orxonox by  doxygen 1.5.6