Commit eb5517fc authored by Quentin Khan's avatar Quentin Khan

Add FNodeIteratorBox constainer interface for FTree walks

FNodeIteratorBox is a dummy container that is used by the tree to offer
begin and end iterator according to the chosen walk order.
parent cbc90032
#ifndef _SCALFMM_NODE_ITERATOR_BOX_
#define _SCALFMM_NODE_ITERATOR_BOX_
#include <iterator>
template <class Node, template <class> class NodeIterator>
class FNodeIteratorBox {
using node_t = Node;
public:
using value_type = node_t;
using reference = node_t&;
using const_reference = const node_t&;
using iterator = NodeIterator<node_t>;
using const_iterator = NodeIterator<const node_t>;
using difference_type = typename iterator::difference_type;
using size_type = std::size_t;
node_t* _root = nullptr;
FNodeIteratorBox(node_t* root) : _root(root) { }
iterator begin() {
return iterator(_root);
}
iterator end() {
return iterator(_root, iterator::IteratorPosition::end);
}
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment