3 #include <GroveTreeWrapper.h>
67 template <
typename Tree>
93 virtual void addTree(std::shared_ptr<Tree> tree) = 0;
106 size_t const startIndex,
size_t const endIndex
125 std::shared_ptr<Tree> tree
131 inline void setTree(
size_t const index, std::shared_ptr<Tree> tree)
159 inline std::shared_ptr<Tree>
operator[] (
size_t const index)
const
Wrapper for trees belonging to a StaticGrove so for-each loop can be used.
Definition: GroveTreeWrapper.h:17
A StaticGrove is an abstract class which declares methods to handle a set of trees.
Definition: StaticGrove.h:68
virtual void removeTrees(size_t const startIndex, size_t const endIndex)=0
Remove trees inside given interval (start inclusive, end exclusive)
virtual Tree * getTreePointer(size_t const index) const =0
Obtain a pointer to the tree at given index.
virtual Tree * nextTreePointer()=0
Obtain the pointer to next tree and advance internal handling so next call will return next true,...
virtual GroveTreeWrapper< Tree > end()
Obtaint the last element of a for-each loop over trees.
Definition: StaticGrove.h:206
virtual void toZeroTree()=0
Restart the internal state of while loop handling.
virtual void removeAll()=0
Remove all trees from the StaticGrove.
virtual std::shared_ptr< Tree > nextTreeShared()=0
Obtain the shared pointer to next tree and advance internal handling so next call will return next tr...
virtual GroveTreeWrapper< Tree > begin()
Obtain the first element of a for-each loop over trees.
Definition: StaticGrove.h:200
void clear()
Alias for StaticGrove::removeAll method.
Definition: StaticGrove.h:117
virtual Tree & getTreeReference(size_t const index) const =0
Obtain a reference to the tree at given index.
virtual bool hasTrees() const =0
Check whether the StaticGrove has trees (true) or not (false)
virtual void addTree(std::shared_ptr< Tree > tree)=0
Add a tree to be handled by the StaticGrove.
virtual Tree & nextTreeReference()=0
Obtain the reference to next tree and advance internal handling so next call will return next true,...
virtual void removeTree(size_t const index)=0
Remove a tree from the StaticGrove.
virtual void replaceTree(size_t const index, std::shared_ptr< Tree > tree)=0
Replace tree at given index by given tree.
virtual size_t getNumTrees() const =0
Obtain the number of trees handled by the StaticGrove.
std::shared_ptr< Tree > operator[](size_t const index) const
Obtain a shared pointer to the tree at given index.
Definition: StaticGrove.h:159
virtual bool hasNextTree() const =0
Check whether there are more trees to be iterated through while loop (true) or not (false)
virtual std::shared_ptr< Tree > getTreeShared(size_t const index) const =0
Obtain a shared pointer to the tree at given index.
void setTree(size_t const index, std::shared_ptr< Tree > tree)
Alias for StaticGrove::replaceTree.
Definition: StaticGrove.h:131