state-observation 1.8.0
General implementation of observers.
Loading...
Searching...
No Matches
stateObservation::IndexedInputArrayInterface Class Referenceabstract

Class that DECLARES all the neccessary functions for the handling of an array of indexed inputs. More...

#include <definitions.hpp>

Inheritance diagram for stateObservation::IndexedInputArrayInterface:
[legend]
Collaboration diagram for stateObservation::IndexedInputArrayInterface:
[legend]

Public Member Functions

 IndexedInputArrayInterface ()
 Default constructor.
 IndexedInputArrayInterface (TimeIndex initTime)
 Construct a new IndexedInputArrayInterface with a predifined size.
virtual void truncateAfter (TimeIndex timeIndex) override=0
 removes all the elements with larger indexes than timeIndex
virtual void truncateBefore (TimeIndex timeIndex) override=0
 removes all the elements with smaller indexes than timeIndex
virtual TimeIndex getLastIndex () const override=0
 Get the time index.
virtual TimeIndex getNextIndex () const override=0
virtual TimeIndex setLastIndex (int index) override=0
 Set the time index of the last element.
virtual TimeIndex getFirstIndex () const override=0
 Get the time index.
virtual TimeIndex setFirstIndex (int index) override=0
 set the time index of the first element
virtual TimeSize size () const override=0
virtual void reset () override=0
virtual void clear () override=0
 Clears the vector but keeps the last index.
virtual bool checkIndex (TimeIndex k) const override=0
 checks whether the index is present in the array
virtual void setValue (const InputBase &value, TimeIndex k)=0
virtual void pushBack (const InputBase &v)=0
 Pushes back the object to the array, the new value will take the next time.
virtual void popFront ()=0
 removes the first (oldest) element of the array
virtual const InputBase & operator[] (TimeIndex time) const =0
 gets a constant reference to the given time index
virtual InputBase & operator[] (TimeIndex index)=0
 gets the value with the given time index, non const version
virtual const InputBase & front () const =0
 gets a pointer to the input at time index. Unsafe since this is not a shared pointer, use with care.
virtual InputBase & front ()=0
 gets the first value
virtual const InputBase & back () const =0
 gets the last value
virtual InputBase & back ()=0
 gets the last value

Protected Member Functions

void check_ (TimeIndex time) const override=0
void check_ () const override=0
void checkNext_ (TimeIndex time) const override=0
Protected Member Functions inherited from stateObservation::IndexedObjectArrayBase
 IndexedObjectArrayBase ()
 Default constructor.
 IndexedObjectArrayBase (TimeIndex initTime)
 Construct a new IndexedObjectArrayT with a predifined size.

Additional Inherited Members

Protected Attributes inherited from stateObservation::IndexedObjectArrayBase
TimeIndex k_

Detailed Description

Class that DECLARES all the neccessary functions for the handling of an array of indexed inputs.

Functions are not defined here since they will be in IndexInputArrayT, which inherits from this class. Allows to call functions on the array for any type of input, while avoiding to template all the code. Here, only IndexInputArrayT is templated within estimators, and not the estimators themselves.

Definition at line 728 of file definitions.hpp.

Constructor & Destructor Documentation

◆ IndexedInputArrayInterface() [1/2]

stateObservation::IndexedInputArrayInterface::IndexedInputArrayInterface ( )
inline

Default constructor.

Definition at line 732 of file definitions.hpp.

◆ IndexedInputArrayInterface() [2/2]

stateObservation::IndexedInputArrayInterface::IndexedInputArrayInterface ( TimeIndex initTime)
inline

Construct a new IndexedInputArrayInterface with a predifined size.

Parameters
sizeis the size of the array
initTimeis the index of the initial time. It is zero by default

Definition at line 738 of file definitions.hpp.

Member Function Documentation

◆ truncateAfter()

virtual void stateObservation::IndexedInputArrayInterface::truncateAfter ( TimeIndex timeIndex)
overridepure virtual

◆ truncateBefore()

virtual void stateObservation::IndexedInputArrayInterface::truncateBefore ( TimeIndex timeIndex)
overridepure virtual

◆ getLastIndex()

virtual TimeIndex stateObservation::IndexedInputArrayInterface::getLastIndex ( ) const
overridepure virtual

◆ getNextIndex()

virtual TimeIndex stateObservation::IndexedInputArrayInterface::getNextIndex ( ) const
overridepure virtual

Get the time index of the next value that will be pushed back Can be used in for loops

Implements stateObservation::IndexedObjectArrayBase.

Implemented in stateObservation::IndexedInputArrayT< InputType, Allocator >, and stateObservation::IndexedInputArrayT< VectorInput >.

◆ setLastIndex()

virtual TimeIndex stateObservation::IndexedInputArrayInterface::setLastIndex ( int index)
overridepure virtual

◆ getFirstIndex()

virtual TimeIndex stateObservation::IndexedInputArrayInterface::getFirstIndex ( ) const
overridepure virtual

◆ setFirstIndex()

virtual TimeIndex stateObservation::IndexedInputArrayInterface::setFirstIndex ( int index)
overridepure virtual

◆ size()

virtual TimeSize stateObservation::IndexedInputArrayInterface::size ( ) const
overridepure virtual

◆ reset()

virtual void stateObservation::IndexedInputArrayInterface::reset ( )
overridepure virtual

Resets the array to initial state the value is no longer accessible

Implements stateObservation::IndexedObjectArrayBase.

Implemented in stateObservation::IndexedInputArrayT< InputType, Allocator >, and stateObservation::IndexedInputArrayT< VectorInput >.

◆ clear()

virtual void stateObservation::IndexedInputArrayInterface::clear ( )
overridepure virtual

◆ checkIndex()

virtual bool stateObservation::IndexedInputArrayInterface::checkIndex ( TimeIndex k) const
overridepure virtual

◆ setValue()

virtual void stateObservation::IndexedInputArrayInterface::setValue ( const InputBase & value,
TimeIndex k )
pure virtual

Sets the value v at the time index k It can be used to push a value into the back of the array

Implemented in stateObservation::IndexedInputArrayT< InputType, Allocator >, and stateObservation::IndexedInputArrayT< VectorInput >.

◆ pushBack()

virtual void stateObservation::IndexedInputArrayInterface::pushBack ( const InputBase & v)
pure virtual

Pushes back the object to the array, the new value will take the next time.

Implemented in stateObservation::IndexedInputArrayT< InputType, Allocator >, and stateObservation::IndexedInputArrayT< VectorInput >.

◆ popFront()

virtual void stateObservation::IndexedInputArrayInterface::popFront ( )
pure virtual

◆ operator[]() [1/2]

virtual const InputBase & stateObservation::IndexedInputArrayInterface::operator[] ( TimeIndex time) const
pure virtual

gets a constant reference to the given time index

Implemented in stateObservation::IndexedInputArrayT< InputType, Allocator >, and stateObservation::IndexedInputArrayT< VectorInput >.

◆ operator[]() [2/2]

virtual InputBase & stateObservation::IndexedInputArrayInterface::operator[] ( TimeIndex index)
pure virtual

gets the value with the given time index, non const version

Implemented in stateObservation::IndexedInputArrayT< InputType, Allocator >, and stateObservation::IndexedInputArrayT< VectorInput >.

◆ front() [1/2]

virtual const InputBase & stateObservation::IndexedInputArrayInterface::front ( ) const
pure virtual

gets a pointer to the input at time index. Unsafe since this is not a shared pointer, use with care.

gets the first value

Implemented in stateObservation::IndexedInputArrayT< InputType, Allocator >, and stateObservation::IndexedInputArrayT< VectorInput >.

◆ front() [2/2]

virtual InputBase & stateObservation::IndexedInputArrayInterface::front ( )
pure virtual

◆ back() [1/2]

virtual const InputBase & stateObservation::IndexedInputArrayInterface::back ( ) const
pure virtual

◆ back() [2/2]

virtual InputBase & stateObservation::IndexedInputArrayInterface::back ( )
pure virtual

◆ check_() [1/2]

void stateObservation::IndexedInputArrayInterface::check_ ( TimeIndex time) const
overrideprotectedpure virtual

Asserts that the index is present in the array does nothing in release mode

Implements stateObservation::IndexedObjectArrayBase.

Implemented in stateObservation::IndexedInputArrayT< InputType, Allocator >, and stateObservation::IndexedInputArrayT< VectorInput >.

◆ check_() [2/2]

void stateObservation::IndexedInputArrayInterface::check_ ( ) const
overrideprotectedpure virtual

Asserts that the array is not empty does nothing in release mode

Implements stateObservation::IndexedObjectArrayBase.

Implemented in stateObservation::IndexedInputArrayT< InputType, Allocator >, and stateObservation::IndexedInputArrayT< VectorInput >.

◆ checkNext_()

void stateObservation::IndexedInputArrayInterface::checkNext_ ( TimeIndex time) const
overrideprotectedpure virtual

Asserts that the given time can be pushed at the back of the vector does nothing in release mode

Implements stateObservation::IndexedObjectArrayBase.

Implemented in stateObservation::IndexedInputArrayT< InputType, Allocator >, and stateObservation::IndexedInputArrayT< VectorInput >.


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