Helios++
Helios software for LiDAR simulations
BasicStaticGrove< Tree > Class Template Reference

Basic implementation of a StaticGrove. More...

#include <BasicStaticGrove.h>

Inheritance diagram for BasicStaticGrove< Tree >:
Collaboration diagram for BasicStaticGrove< Tree >:

Public Member Functions

 BasicStaticGrove ()=default
 Default constructor for BasicStaticGrove.
 
bool hasTrees () const override
 
size_t getNumTrees () const override
 
void addTree (std::shared_ptr< Tree > tree) override
 
void removeTree (size_t const index) override
 
void removeTrees (size_t const startIndex, size_t const endIndex) override
 
void removeAll () override
 
void replaceTree (size_t const index, std::shared_ptr< Tree > tree) override
 Replace tree at given index by given tree. More...
 
Tree & getTreeReference (size_t const index) const override
 
std::shared_ptr< Tree > getTreeShared (size_t const index) const override
 
Tree * getTreePointer (size_t const index) const override
 
void toZeroTree () override
 
bool hasNextTree () const override
 
Tree & nextTreeReference () override
 
std::shared_ptr< Tree > nextTreeShared () override
 
Tree * nextTreePointer () override
 
- Public Member Functions inherited from StaticGrove< Tree >
void clear ()
 Alias for StaticGrove::removeAll method. More...
 
void setTree (size_t const index, std::shared_ptr< Tree > tree)
 Alias for StaticGrove::replaceTree. More...
 
std::shared_ptr< Tree > operator[] (size_t const index) const
 Obtain a shared pointer to the tree at given index. More...
 
virtual GroveTreeWrapper< Tree > begin ()
 Obtain the first element of a for-each loop over trees. More...
 
virtual GroveTreeWrapper< Tree > end ()
 Obtaint the last element of a for-each loop over trees. More...
 

Protected Attributes

std::vector< std::shared_ptr< Tree > > trees
 The trees contained in the grove.
 
size_t whileIter
 Current iteration for while loop friendly methods.
 

Detailed Description

template<typename Tree>
class BasicStaticGrove< Tree >

Basic implementation of a StaticGrove.

Author
Alberto M. Esmoris Pena
Version
1.0
Template Parameters
TreeThe type of tree to be handled
See also
StaticGrove

Member Function Documentation

◆ addTree()

template<typename Tree >
void BasicStaticGrove< Tree >::addTree ( std::shared_ptr< Tree >  tree)
overridevirtual

◆ getNumTrees()

template<typename Tree >
size_t BasicStaticGrove< Tree >::getNumTrees ( ) const
overridevirtual

◆ getTreePointer()

template<typename Tree >
Tree* BasicStaticGrove< Tree >::getTreePointer ( size_t const  index) const
overridevirtual

◆ getTreeReference()

template<typename Tree >
Tree& BasicStaticGrove< Tree >::getTreeReference ( size_t const  index) const
overridevirtual

◆ getTreeShared()

template<typename Tree >
std::shared_ptr<Tree> BasicStaticGrove< Tree >::getTreeShared ( size_t const  index) const
overridevirtual

◆ hasNextTree()

template<typename Tree >
bool BasicStaticGrove< Tree >::hasNextTree ( ) const
overridevirtual

◆ hasTrees()

template<typename Tree >
bool BasicStaticGrove< Tree >::hasTrees ( ) const
overridevirtual

◆ nextTreePointer()

template<typename Tree >
Tree* BasicStaticGrove< Tree >::nextTreePointer ( )
overridevirtual

◆ nextTreeReference()

template<typename Tree >
Tree& BasicStaticGrove< Tree >::nextTreeReference ( )
overridevirtual

◆ nextTreeShared()

template<typename Tree >
std::shared_ptr<Tree> BasicStaticGrove< Tree >::nextTreeShared ( )
overridevirtual

◆ removeAll()

template<typename Tree >
void BasicStaticGrove< Tree >::removeAll ( )
overridevirtual

◆ removeTree()

template<typename Tree >
void BasicStaticGrove< Tree >::removeTree ( size_t const  index)
overridevirtual

◆ removeTrees()

template<typename Tree >
void BasicStaticGrove< Tree >::removeTrees ( size_t const  startIndex,
size_t const  endIndex 
)
overridevirtual

◆ replaceTree()

template<typename Tree >
void BasicStaticGrove< Tree >::replaceTree ( size_t const  index,
std::shared_ptr< Tree >  tree 
)
overridevirtual

Replace tree at given index by given tree.

Parameters
indexIndex of tree to be replaced
treeNew tree

Implements StaticGrove< Tree >.

◆ toZeroTree()

template<typename Tree >
void BasicStaticGrove< Tree >::toZeroTree ( )
overridevirtual

The documentation for this class was generated from the following file: