Helios++
Helios software for LiDAR simulations
DynSequence< T > Class Template Reference

Dynamic sequence is a set of elements that must be applied during dynamic simulations to provide dynamic behavior to dynamic objects. More...

#include <DynSequence.h>

Collaboration diagram for DynSequence< T >:

Public Member Functions

 DynSequence ()
 Default constructor for the dynamic sequence.
 
 DynSequence (string id, string next, size_t loop)
 Dynamic sequence basic constructor. More...
 
vector< shared_ptr< T > > nextStep ()
 Obtain sequence corresponding to next step.
 
void restart ()
 Restart the dynamic sequence so when nextStep is called again it will start from the first iteration.
 
void append (shared_ptr< T > element)
 Append an element to the sequence. More...
 
void append (vector< shared_ptr< T >> elements)
 Append vector of elements to the end of the sequence. More...
 
shared_ptr< T > get (size_t index) const
 Obtain element at given index in the sequence. More...
 
void set (size_t index, shared_ptr< T > element)
 Set element at given index in the sequence. More...
 
void remove (size_t index)
 Remove element at given index in the sequence. More...
 
size_t size () const
 Obtain the number of elements composing the sequence. More...
 
vector< T >::iterator begin ()
 Obtain a iterator pointing to the first dynamic sequence element. More...
 
vector< T >::iterator end ()
 Obtain a iterator pointing to the last dynamic sequence element. More...
 
void clear ()
 Remove all elements composing the sequence.
 
size_t getIteration () const
 Get current iteration. More...
 
size_t getLoop () const
 Get loop value (max iterations) More...
 
void setLoop (size_t const loop)
 Set loop value (max iterations) More...
 
string getId () const
 Get current identifier for the dynamic sequence. More...
 
void setId (string const &id) const
 Set identifier for the dynamic sequence. More...
 
string getNext () const
 Get next identifier for the dynamic sequence. More...
 
void setNext (string const &next)
 Set next identifier for the dynamic sequence. More...
 

Protected Attributes

string id
 Unique identifier for the dynamic sequence.
 
string next
 Unique identifier for dynamic sequence that must come after this one. More...
 
size_t loop
 Specify for how long the dynamic sequence must be repeated, using simulation steps as unit.
 
vector< shared_ptr< T > > sequence
 The elements composing the dynamic sequence.
 
size_t iteration = 0
 Current iteration. It is used to control the dynamic sequence application loop. By default, it must applied until iteration \(=\) loop.
 

Private Member Functions

template<typename Archive >
void serialize (Archive &ar, const unsigned int version)
 Serialize a dynamic sequence to a stream of bytes. More...
 

Friends

class boost::serialization::access
 

Detailed Description

template<typename T>
class DynSequence< T >

Dynamic sequence is a set of elements that must be applied during dynamic simulations to provide dynamic behavior to dynamic objects.

Author
Alberto M. Esmoris Pena
Version
1.0
Template Parameters
TType of elements composing the sequence

A dynamic sequence consists in a set of elements called the sequence \(\mathcal{S}=\left\{S_1, \ldots, S_m\right\}\). The dynamic sequence is looped \(l\) times. To illustrate this, let \(f_t\left(\mathcal{S}, X\right)\) be the function which applies the sequence \(\mathcal{S}\) to a dynamic object \(X\) at \(t\) time. Thus, applying a dynamic sequence can be summarized in following expression:

\[ \forall t \in [1, l], f_t\left(\mathcal{S}, X\right) \]

Once the sequence is applied, the sequence identified by the next attribute of finished sequence will be applied, if any.

See also
DynSequencer

Constructor & Destructor Documentation

◆ DynSequence()

template<typename T >
DynSequence< T >::DynSequence ( string  id,
string  next,
size_t  loop 
)
inline

Dynamic sequence basic constructor.

Parameters
idIdentifier for the dynamic sequence
nextIdentifier of next dynamic sequence
loopFor how many steps the dynamic sequence must be applied
See also
DynSequence::id
DynSequence::next
DynSequence::loop

Member Function Documentation

◆ append() [1/2]

template<typename T >
void DynSequence< T >::append ( shared_ptr< T >  element)
inline

Append an element to the sequence.

Parameters
elementElement to be appended to the sequence
See also
DynSequence::sequence

◆ append() [2/2]

template<typename T >
void DynSequence< T >::append ( vector< shared_ptr< T >>  elements)
inline

Append vector of elements to the end of the sequence.

Parameters
elementsVector of elements to be appended to the end of the sequence
See also
DynSequence::sequence

◆ begin()

template<typename T >
vector<T>::iterator DynSequence< T >::begin ( )
inline

Obtain a iterator pointing to the first dynamic sequence element.

Returns
Iterator pointing to the first dynamic sequence element

◆ end()

template<typename T >
vector<T>::iterator DynSequence< T >::end ( )
inline

Obtain a iterator pointing to the last dynamic sequence element.

Returns
Iterator pointing to the last dynamic sequence element

◆ get()

template<typename T >
shared_ptr<T> DynSequence< T >::get ( size_t  index) const
inline

Obtain element at given index in the sequence.

Parameters
indexIndex of element to be retrieved
Returns
Element at given index
See also
DynSequence::sequence

◆ getId()

template<typename T >
string DynSequence< T >::getId ( ) const
inline

Get current identifier for the dynamic sequence.

Returns
Current identifier for the dynamic sequence
See also
DynSequence::getId

◆ getIteration()

template<typename T >
size_t DynSequence< T >::getIteration ( ) const
inline

Get current iteration.

Returns
Current iteration
See also
DynSequence::iteration

◆ getLoop()

template<typename T >
size_t DynSequence< T >::getLoop ( ) const
inline

Get loop value (max iterations)

Returns
Loop value (max iterations)
See also
DynSequence::loop

◆ getNext()

template<typename T >
string DynSequence< T >::getNext ( ) const
inline

Get next identifier for the dynamic sequence.

Returns
Identifier of next dynamic sequence

◆ remove()

template<typename T >
void DynSequence< T >::remove ( size_t  index)
inline

Remove element at given index in the sequence.

Parameters
indexIndex of the element to be removed
See also
DynSequence::sequence

◆ serialize()

template<typename T >
template<typename Archive >
void DynSequence< T >::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

Serialize a dynamic sequence to a stream of bytes.

Template Parameters
ArchiveType of rendering
Parameters
arSpecific rendering for the stream of bytes
versionVersion number for the dynamic sequence

◆ set()

template<typename T >
void DynSequence< T >::set ( size_t  index,
shared_ptr< T >  element 
)
inline

Set element at given index in the sequence.

Parameters
indexIndex of element to be retrieved
elementElement at given index
See also
DynSequence::sequence

◆ setId()

template<typename T >
void DynSequence< T >::setId ( string const &  id) const
inline

Set identifier for the dynamic sequence.

Parameters
idNew identifier for the dynamic sequence
See also
DynSequence::setId

◆ setLoop()

template<typename T >
void DynSequence< T >::setLoop ( size_t const  loop)
inline

Set loop value (max iterations)

Parameters
loopNew loop value (max iterations)
See also
DynSequence::loop

◆ setNext()

template<typename T >
void DynSequence< T >::setNext ( string const &  next)
inline

Set next identifier for the dynamic sequence.

Parameters
nextIdentifier for new next dynamic sequence

◆ size()

template<typename T >
size_t DynSequence< T >::size ( ) const
inline

Obtain the number of elements composing the sequence.

Returns
Number of elements composing the sequence
See also
DynSequence::sequence

Member Data Documentation

◆ next

template<typename T >
string DynSequence< T >::next
protected

Unique identifier for dynamic sequence that must come after this one.

NOTICE in case there is no sequence after this one, next should be an empty string ""


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