MIRA
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
Node Class Reference

#include <topomap/Node.h>

Inheritance diagram for Node:
Inheritance graph
[legend]

Public Member Functions

 Node ()
 
 ~Node ()
 
NodePtr thisP ()
 
template<typename Reflector >
void reflect (Reflector &r)
 
NodePtr getParent ()
 
const NodePtr getParent () const
 
bool isLeaf () const
 
const std::string getFullName () const
 
virtual GraphElementPtr findElement (const std::string &predicate)
 
virtual AttributePtr getAttributeUntyped (const std::string &name, const mira::Class &clazz, bool inherited=true)
 Returns NULL, if no such attribute exsits. More...
 
virtual void getAllAttributesUntyped (std::map< std::string, AttributePtr > &oAttributes, const mira::Class &clazz, bool inherited=true)
 
const NodeSetgetChildNodes ()
 
const GatewayNodeSetgetGatewayNodes ()
 
template<typename Visitor >
void visitChildNodes (Visitor &&visitor, bool recursively=true)
 Calls the operator()(NodePtr node) of the given visitor for each child node (by default recursively in depth-first order) More...
 
virtual void setAttribute (const std::string &name, AttributePtr attribute)
 Sets the given object as attribute with the given name. More...
 
virtual void removeAttribute (const std::string &name, const mira::Class &attrClass)
 Removes the attribute with the given name and type. More...
 
template<typename AttributeClass >
void removeAttribute (const std::string &name)
 same as above, but easier interface, where datatype is specified as template parameter More...
 
template<typename AttributeClass >
boost::shared_ptr< AttributeClass > getAttribute (const std::string &name, bool inherited=true)
 Returns NULL, if no such attribute exsits. More...
 
template<typename AttributeClass >
std::map< std::string, boost::shared_ptr< AttributeClass > > getAllAttributes (bool inherited=true)
 
template<typename AttributeClass >
boost::shared_ptr< AttributeClass > obtainAttribute (const std::string &name)
 Similar to getAttribute, but this method will create the attribute, if it does not exist yet. More...
 
virtual void setName (const std::string &name)
 
virtual const std::string & getName () const
 
virtual const GraphElementPtr findElement (const std::string &predicate) const
 

Static Public Member Functions

static NodePtr create ()
 

Protected Member Functions

void addChildNode (NodePtr node)
 
void addGatewayNode (GatewayNodePtr gatewayNode)
 

Protected Attributes

std::map< AttributeKey, AttributePtrmAttributes
 
std::string mName
 

Static Protected Attributes

static volatile uint32 sID
 

Friends

class TopoMap
 

Constructor & Destructor Documentation

◆ Node()

Node ( )

◆ ~Node()

~Node ( )

Member Function Documentation

◆ create()

static NodePtr create ( )
inlinestatic

◆ thisP()

NodePtr thisP ( )
inline

◆ reflect()

void reflect ( Reflector &  r)
inline

◆ getParent() [1/2]

NodePtr getParent ( )
inline

◆ getParent() [2/2]

const NodePtr getParent ( ) const
inline

◆ isLeaf()

bool isLeaf ( ) const
inline

◆ getFullName()

const std::string getFullName ( ) const

◆ findElement() [1/2]

virtual GraphElementPtr findElement ( const std::string &  predicate)
virtual

Reimplemented from GraphElement.

◆ getAttributeUntyped()

virtual AttributePtr getAttributeUntyped ( const std::string &  name,
const mira::Class clazz,
bool  inherited = true 
)
virtual

Returns NULL, if no such attribute exsits.

Reimplemented from AttributedGraphElement.

◆ getAllAttributesUntyped()

virtual void getAllAttributesUntyped ( std::map< std::string, AttributePtr > &  oAttributes,
const mira::Class clazz,
bool  inherited = true 
)
virtual

Reimplemented from AttributedGraphElement.

◆ getChildNodes()

const NodeSet& getChildNodes ( )
inline

◆ getGatewayNodes()

const GatewayNodeSet& getGatewayNodes ( )
inline

◆ visitChildNodes()

void visitChildNodes ( Visitor &&  visitor,
bool  recursively = true 
)
inline

Calls the operator()(NodePtr node) of the given visitor for each child node (by default recursively in depth-first order)

◆ addChildNode()

void addChildNode ( NodePtr  node)
protected

◆ addGatewayNode()

void addGatewayNode ( GatewayNodePtr  gatewayNode)
protected

◆ setAttribute()

virtual void setAttribute ( const std::string &  name,
AttributePtr  attribute 
)
virtualinherited

Sets the given object as attribute with the given name.

◆ removeAttribute() [1/2]

virtual void removeAttribute ( const std::string &  name,
const mira::Class attrClass 
)
virtualinherited

Removes the attribute with the given name and type.

◆ removeAttribute() [2/2]

void removeAttribute ( const std::string &  name)
inlineinherited

same as above, but easier interface, where datatype is specified as template parameter

◆ getAttribute()

boost::shared_ptr<AttributeClass> getAttribute ( const std::string &  name,
bool  inherited = true 
)
inlineinherited

Returns NULL, if no such attribute exsits.

◆ getAllAttributes()

std::map<std::string, boost::shared_ptr<AttributeClass> > getAllAttributes ( bool  inherited = true)
inlineinherited

◆ obtainAttribute()

boost::shared_ptr<AttributeClass> obtainAttribute ( const std::string &  name)
inlineinherited

Similar to getAttribute, but this method will create the attribute, if it does not exist yet.

So this method will always return a valid pointer to an attribute. Moreover, it does NOT look for inherited attributes. The AttributeClass must be default-constructable to be used with this method.

◆ setName()

virtual void setName ( const std::string &  name)
inlinevirtualinherited

◆ getName()

virtual const std::string& getName ( ) const
inlinevirtualinherited

◆ findElement() [2/2]

virtual const GraphElementPtr findElement ( const std::string &  predicate) const
inlinevirtualinherited

Friends And Related Function Documentation

◆ TopoMap

friend class TopoMap
friend

Member Data Documentation

◆ mAttributes

std::map<AttributeKey, AttributePtr> mAttributes
protectedinherited

◆ mName

std::string mName
protectedinherited

◆ sID

volatile uint32 sID
staticprotectedinherited

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