9 #ifndef MRPT_DIRECTED_TREE_H
10 #define MRPT_DIRECTED_TREE_H
50 template <
class TYPE_EDGES = u
int8_t>
61 TEdgeInfo(
TNodeID child_id_,
bool direction_child_to_parent=
false,
const TYPE_EDGES & edge_data = TYPE_EDGES() ) :
id(child_id_),
reverse(direction_child_to_parent),
data(edge_data) { }
96 const size_t next_depth_level = root_depth_level+1;
99 const TListEdges &children = itChildren->second;
102 user_visitor.OnVisitNode(
root,*itEdge,next_depth_level);
110 const size_t next_depth_level = root_depth_level+1;
113 const TListEdges &children = itChildren->second;
115 user_visitor.OnVisitNode(
root,*itEdge,next_depth_level);
132 std::ostringstream s;
135 std::ostringstream &m_s;
136 CMyVisitor(std::ostringstream &s) : m_s(s) { }
138 m_s << std::string(depth_level*5,
' ') << (edge_to_child.
reverse ?
"<-" :
"->" )
139 << edge_to_child.
id << std::endl;
142 CMyVisitor myVisitor(s);
143 s <<
root << std::endl;