MIRA
Classes | Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
AttributedGraphElement Class Reference

#include <topomap/GraphElement.h>

Inheritance diagram for AttributedGraphElement:
Inheritance graph
[legend]

Classes

struct  AttributeKey
 

Public Member Functions

 AttributedGraphElement (const std::string &prefix, int)
 
 AttributedGraphElement (const std::string &name)
 
virtual ~AttributedGraphElement ()
 
template<typename Reflector >
void reflect (Reflector &r)
 
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...
 
virtual AttributePtr getAttributeUntyped (const std::string &name, const mira::Class &clazz, bool inherited=true)
 Returns NULL, if no such attribute exsits. More...
 
template<typename AttributeClass >
boost::shared_ptr< AttributeClass > getAttribute (const std::string &name, 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)
 
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 GraphElementPtr findElement (const std::string &predicate)
 
virtual const GraphElementPtr findElement (const std::string &predicate) const
 

Protected Attributes

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

Static Protected Attributes

static volatile uint32 sID
 

Constructor & Destructor Documentation

◆ AttributedGraphElement() [1/2]

AttributedGraphElement ( const std::string &  prefix,
int   
)
inline

◆ AttributedGraphElement() [2/2]

AttributedGraphElement ( const std::string &  name)
inline

◆ ~AttributedGraphElement()

virtual ~AttributedGraphElement ( )
virtual

Member Function Documentation

◆ reflect()

void reflect ( Reflector &  r)
inline

◆ setAttribute()

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

Sets the given object as attribute with the given name.

◆ removeAttribute() [1/2]

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

Removes the attribute with the given name and type.

◆ removeAttribute() [2/2]

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

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

◆ getAttributeUntyped()

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

Returns NULL, if no such attribute exsits.

Reimplemented in Node.

◆ getAttribute()

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

Returns NULL, if no such attribute exsits.

◆ getAllAttributesUntyped()

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

Reimplemented in Node.

◆ getAllAttributes()

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

◆ obtainAttribute()

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

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() [1/2]

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

Reimplemented in GatewayNode, and Node.

◆ findElement() [2/2]

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

Member Data Documentation

◆ mAttributes

std::map<AttributeKey, AttributePtr> mAttributes
protected

◆ mName

std::string mName
protectedinherited

◆ sID

volatile uint32 sID
staticprotectedinherited

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