|
fennec
|
Rooted-Directed Tree. More...
#include <rdtree.h>
| TypeT | Data type |
| AllocT | Allocator Type |
Public Member Functions | |
Constructors & Destructor | |
| template<typename... ArgsT> | |
| constexpr | rdtree (ArgsT &&...args) |
| Root Constructor, constructs the root node of the tree. | |
| constexpr | rdtree (const rdtree &tree) |
Copy Constructor, copies the contents of tree | |
| constexpr | rdtree (rdtree &&tree) noexcept |
Move Constructor, takes ownership over the contents of tree | |
Assignment | |
| constexpr rdtree & | operator= (const rdtree &rhs) |
| Copy Assignment Operator. | |
| constexpr rdtree & | operator= (rdtree &&rhs) noexcept |
| Move Assignment Operator. | |
Properties | |
| constexpr size_t | size () const |
| constexpr size_t | capacity () const |
| constexpr bool | empty () const |
| constexpr size_t | parent (size_t i) const |
| constexpr size_t | child (size_t i, size_t n=0) const |
| constexpr size_t | next (size_t i, size_t n=0) const |
| constexpr size_t | prev (size_t i, size_t n=0) const |
| constexpr size_t | left_most (size_t i) const |
| constexpr size_t | right_most (size_t i) const |
| constexpr size_t | depth (size_t i) const |
| constexpr size_t | num_children (size_t i) const |
| constexpr size_t | next_id () const |
| constexpr value_t & | operator[] (size_t i) |
| constexpr const value_t & | operator[] (size_t i) const |
| constexpr size_t | insert (size_t parent, size_t next, const value_t &val) |
Insertion, creates a node in the tree with parent parent | |
| constexpr size_t | insert (size_t parent, size_t next, value_t &&val) |
Insertion, creates a node in the tree with parent parent | |
| template<typename... ArgsT> | |
| constexpr size_t | emplace (size_t parent, size_t next, ArgsT &&...args) |
Insertion, creates a node in the tree with parent parent | |
| constexpr void | swap (size_t i0, size_t i1) |
| Swap two nodes. | |
| constexpr void | erase (size_t i) |
| Erase a node in the tree and all of it's children. | |
| template<typename OrderT , typename VisitorT > | |
| constexpr void | traverse (VisitorT &&visit, size_t i=root) |
| Traverse the tree using a specified order and visiting functor. | |
|
inlineexplicitconstexpr |
| ArgsT | The argument types |
| args | The arguments to construct the root with |
|
inlineconstexpr |
| tree | the rdtree to copy |
|
inlineconstexprnoexcept |
| tree | the rdtree to move |
|
inlineconstexpr |
| rhs | the rdtree to copy |
this after copying the contents of rhs
|
inlineconstexprnoexcept |
| rhs | the rdtree to move |
this after taking ownership over the contents of rhs
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
true when there are no nodes in the tree, false otherwise
|
inlineconstexpr |
| i | The id of the node to check |
|
inlineconstexpr |
| i | The id of the node to check |
|
inlineconstexpr |
| i | The id of the node to check |
|
inlineconstexpr |
| i | The id of the node to check |
|
inlineconstexpr |
| i | the node to start at |
i
|
inlineconstexpr |
| i | the node to start at |
i
|
inlineconstexpr |
| i | The id of the node to check |
|
inlineconstexpr |
| i | The id of the node to check |
|
inlineconstexpr |
insert or emplace to be called
|
inlineconstexpr |
| i | The id of the node to access |
|
inlineconstexpr |
| i | The id of the node to access |
|
inlineconstexpr |
| parent | the parent node, if npos sets the value of the root node |
| next | the next node, as an index relative to the parent, i.e. parent[0] == parent.child, parent[1] == parent.child.next |
| val | the value to insert |
|
inlineconstexpr |
| parent | the parent node, if npos sets the value of the root node |
| next | the next node, as an index relative to the parent |
| val | the value to insert |
|
inlineconstexpr |
| parent | the parent node, if npos sets the value of the root node |
| next | the next node, as an index relative to the parent, i.e. parent[0] == parent.child, parent[1] == parent.child.next |
| args | the args to construct the value to insert |
|
inlineconstexpr |
| i0 | The id of the first node |
| i1 | The id of the second node |
|
inlineconstexpr |
| i | the index of the node |
|
inlineconstexpr |
The visitor should accept a reference to a value of type TypeT and a size_t which contains the node's id. The visitor should return one of the following values in the fennec::traversal_control_ enum
| OrderT | The order with which to traverse the tree. |
| VisitorT | The visitor, should fulfill the signature uint8_t visit(TypeT&, size_t) |
| visit | The visiting object |
| i | The node to start at |