57 template<
typename value_t>
class Tree;
59 template<
typename value_t>
68 std::vector<std::shared_ptr<Tree<value_t>>>
subtrees;
72 Node(
const value_type& value) {
79 if(i >= subtrees.size())
80 throw std::out_of_range(
"i is too big");
85 if(i > subtrees.size())
86 throw std::out_of_range(
"i is too big");
87 if(subtrees.size() == i)
88 subtrees.push_back(pT);
109 template<
typename value_t>
value_type val
Definition: linked_impl.h:66
void set_parent(std::shared_ptr< Node< value_type >> new_parent)
Definition: linked_impl.h:103
std::shared_ptr< Tree< value_t > > get_ith_subtree(int i)
Definition: linked_impl.h:78
InIter inend() const
Definition: linked_impl.h:128
PreIter prebegin() const
Definition: linked_impl.h:125
Definition: linked_impl.h:60
value_type get_val()
Definition: linked_impl.h:93
Node(const value_type &value)
Definition: linked_impl.h:72
std::vector< std::shared_ptr< Tree< value_t > > > subtrees
Definition: linked_impl.h:68
Node< value_type > & get_parent()
Definition: linked_impl.h:100
Node< value_type > & root
Definition: linked_impl.h:115
void set_val(const value_type &value)
Definition: linked_impl.h:96
value_t value_type
Definition: linked_impl.h:113
PostIter postend() const
Definition: linked_impl.h:130
A generic tree data structre.
Definition: linked_impl.h:57
Tree(const Node< value_type > &root_node)
Definition: linked_impl.h:117
InIter inbegin() const
Definition: linked_impl.h:127
void set_ith_subtree(std::shared_ptr< Tree< value_type >> pT, int i)
Definition: linked_impl.h:84
PreIter preend() const
Definition: linked_impl.h:126
value_t value_type
Definition: linked_impl.h:62
PostIter postbegin() const
Definition: linked_impl.h:129
std::shared_ptr< Node > parent
Definition: linked_impl.h:64