30 #ifndef __CLAW_TREE_HPP__
31 #define __CLAW_TREE_HPP__
53 typedef std::list< tree<T> > child_list;
56 typedef typename child_list::iterator iterator;
57 typedef typename child_list::const_iterator const_iterator;
61 explicit tree(
const T& that );
70 iterator
find(
const T& v );
71 const_iterator
find(
const T& v )
const;
76 const_iterator
begin()
const;
77 const_iterator
end()
const;
92 #endif // __CLAW_TREE_HPP__
iterator end()
Get an iterator just past the end of the children.
self_type & add_child(const T &v)
Add a child to this node.
T value
The value in this node.
Implementation of the claw::tree class.
A tree structure with any number of children.
tree()
Default constructor.
tree< T > self_type
The type of the current class.
T value_type
The type of the value stored in the nodes.
iterator find(const T &v)
Search the first child having a given value.
iterator begin()
Get an iterator on the begining of the children.
bool operator==(const self_type &that) const
Equality operator.
bool is_leaf() const
Tell if this node is a leaf (ie. it has no child).