29 #include <serialization/adapters/std/set> 30 #include <serialization/adapters/boost/shared_ptr.hpp> 35 namespace viros {
namespace topomap {
49 return boost::make_shared<Node>();
53 return shared_from_this();
58 template<
typename Reflector>
62 r.member(
"Children", mChildren,
"");
63 r.member(
"Parent", mParent,
"");
64 r.member(
"GatewayNodes", mGatewayNodes,
"");
72 bool isLeaf()
const {
return mChildren.empty(); }
99 template <
typename Visitor>
102 foreach(
auto n, mChildren)
106 n->visitChildNodes(visitor,recursively);
124 std::ostream&
operator<<(std::ostream& os,
const Node& node);
void visitChildNodes(Visitor &&visitor, bool recursively=true)
Calls the operator()(NodePtr node) of the given visitor for each child node (by default recursively i...
Definition: Node.h:100
virtual AttributePtr getAttributeUntyped(const std::string &name, const mira::Class &clazz, bool inherited=true)
Returns NULL, if no such attribute exsits.
bool isLeaf() const
Definition: Node.h:72
void addChildNode(NodePtr node)
boost::shared_ptr< GatewayNode > GatewayNodePtr
Definition: TopoMapFwd.h:87
const std::string getFullName() const
const GatewayNodeSet & getGatewayNodes()
Definition: Node.h:91
NodePtr getParent()
Definition: Node.h:69
boost::shared_ptr< Attribute > AttributePtr
Definition: TopoMapFwd.h:73
virtual GraphElementPtr findElement(const std::string &predicate)
std::set< NodePtr, shared_ptr_sort< Node > > NodeSet
Definition: TopoMapFwd.h:101
const NodePtr getParent() const
Definition: Node.h:70
static NodePtr create()
Definition: Node.h:48
void addGatewayNode(GatewayNodePtr gatewayNode)
void reflect(Reflector &r)
Definition: Node.h:59
NodePtr thisP()
Definition: Node.h:52
virtual void getAllAttributesUntyped(std::map< std::string, AttributePtr > &oAttributes, const mira::Class &clazz, bool inherited=true)
boost::shared_ptr< GraphElement > GraphElementPtr
Definition: TopoMapFwd.h:80
std::ostream & operator<<(std::ostream &os, const GatewayNode &gatewayNode)
boost::shared_ptr< Node > NodePtr
Definition: TopoMapFwd.h:84
Definition: MetricCostmapTopoMapPlanner.h:45
void reflect(Reflector &r)
Definition: GraphElement.h:101
const NodeSet & getChildNodes()
Definition: Node.h:90
std::set< GatewayNodePtr, shared_ptr_sort< GatewayNode > > GatewayNodeSet
Definition: TopoMapFwd.h:102
Definition: GraphElement.h:91