Public Member Functions | Protected Attributes | List of all members
tuw::StateNestedArray< SubState, N > Class Template Reference

Implementation of State being formed by an array of substates. More...

#include <state_nested_array.h>

Inheritance diagram for tuw::StateNestedArray< SubState, N >:
Inheritance graph
[legend]

Public Member Functions

virtual StateSPtr cloneState () const override
 Clone-to-base-class-ptr function. More...
 
StateNestedArrayoperator= (const StateNestedArray &)=default
 
StateNestedArrayoperator= (StateNestedArray &&)=default
 
StateSPtrstate (const std::size_t &_i) override
 Access sub-state based on index _i. More...
 
 StateNestedArray (State *_parent)
 
 StateNestedArray ()
 
 StateNestedArray (const StateNestedArray &)=default
 
 StateNestedArray (StateNestedArray &&)=default
 
std::shared_ptr< SubState > & stateScoped (const size_t &_i)
 
size_t stateSize () const override
 Size of the sub-states. More...
 
void updateSize () override
 Performs internal manipulation when any of the underlying arrays are being resized. More...
 
double & value (const std::size_t &_i) override
 Access state variable based on index _i. More...
 
const double & value (const std::size_t &_i) const override
 Const access state variable based on index _i. More...
 
size_t valueSize () const override
 Size of the state variables. More...
 
virtual ~StateNestedArray ()=default
 
- Public Member Functions inherited from tuw::State
void fromEIGENVec (const Eigen::VectorXd &_vec)
 Copies all values from an Eigen vector. The valueSize of the State object has to be equal with the Eigen vector size. More...
 
void fromSTLVec (const std::vector< double > &_vec)
 Copies all values from an STL vector. The valueSize of the State object has to be equal with the STL vector size. More...
 
Stateoperator= (const State &)=default
 
Stateoperator= (State &&)=default
 
virtual void resize (const size_t &_i)
 Resizes the array. More...
 
 State (State *_parent)
 
 State ()
 
 State (const State &)=default
 
 State (State &&)=default
 
void toEIGENVec (Eigen::VectorXd &_vec)
 Converts all the array values to an Eigen vector. More...
 
void toSTLVec (std::vector< double > &_vec)
 Converts all the array values to an STL vector. More...
 
virtual ~State ()=default
 

Protected Attributes

std::array< std::shared_ptr< SubState >, N > states_
 
std::array< StateSPtr, N > statesBase_
 
size_t statesSize_
 
std::vector< double * > values_
 
size_t valueSize_
 
- Protected Attributes inherited from tuw::State
Stateparent_
 Pointer to the parent State structure. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from tuw::State
static std::vector< double > & minus (State &_lhs, State &_rhs, std::vector< double > &_ans)
 Performs substraction. Left and right operand are required to have the same valueSize. More...
 
static Eigen::VectorXd & minus (State &_lhs, State &_rhs, Eigen::VectorXd &_ans)
 Performs substraction. Left and right operand are required to have the same valueSize. More...
 
static Stateminus (State &_lhs, State &_rhs, State &_ans)
 Performs substraction. Answer variable, left operand and right operand are required to have the same valueSize. More...
 
static std::vector< double > & plus (State &_lhs, State &_rhs, std::vector< double > &_ans)
 Performs addition. Left and right operand are required to have the same valueSize. More...
 
static Eigen::VectorXd & plus (State &_lhs, State &_rhs, Eigen::VectorXd &_ans)
 Performs addition. Left and right operand are required to have the same valueSize. More...
 
static Stateplus (State &_lhs, State &_rhs, State &_ans)
 Performs addition. Answer variable, left operand and right operand are required to have the same valueSize. More...
 
- Protected Member Functions inherited from tuw::State
void callRootUpdateSize ()
 Calls (if present) the parent updateSize procedure. Otherwise performs root updateSize. More...
 

Detailed Description

template<typename SubState, size_t N>
class tuw::StateNestedArray< SubState, N >

Implementation of State being formed by an array of substates.

Template Parameters
SubStateType of state defining the sub-states of the object.
NSize of sub-states.

Definition at line 50 of file state_nested_array.h.

Constructor & Destructor Documentation

template<typename SubState, size_t N>
tuw::StateNestedArray< SubState, N >::StateNestedArray ( State _parent)
inline

Definition at line 63 of file state_nested_array.h.

template<typename SubState, size_t N>
tuw::StateNestedArray< SubState, N >::StateNestedArray ( )
inline

Definition at line 74 of file state_nested_array.h.

template<typename SubState, size_t N>
virtual tuw::StateNestedArray< SubState, N >::~StateNestedArray ( )
virtualdefault
template<typename SubState, size_t N>
tuw::StateNestedArray< SubState, N >::StateNestedArray ( const StateNestedArray< SubState, N > &  )
default
template<typename SubState, size_t N>
tuw::StateNestedArray< SubState, N >::StateNestedArray ( StateNestedArray< SubState, N > &&  )
default

Member Function Documentation

template<typename SubState, size_t N>
virtual StateSPtr tuw::StateNestedArray< SubState, N >::cloneState ( ) const
inlineoverridevirtual

Clone-to-base-class-ptr function.

Implements tuw::State.

Reimplemented in tuw::StateNestedArrayScoped< EnumStateVals, SubState >.

Definition at line 100 of file state_nested_array.h.

template<typename SubState, size_t N>
StateNestedArray& tuw::StateNestedArray< SubState, N >::operator= ( const StateNestedArray< SubState, N > &  )
default
template<typename SubState, size_t N>
StateNestedArray& tuw::StateNestedArray< SubState, N >::operator= ( StateNestedArray< SubState, N > &&  )
default
template<typename SubState, size_t N>
StateSPtr& tuw::StateNestedArray< SubState, N >::state ( const std::size_t &  _i)
inlineoverridevirtual

Access sub-state based on index _i.

Reimplemented from tuw::State.

Definition at line 130 of file state_nested_array.h.

template<typename SubState, size_t N>
std::shared_ptr<SubState>& tuw::StateNestedArray< SubState, N >::stateScoped ( const size_t &  _i)
inline

Definition at line 136 of file state_nested_array.h.

template<typename SubState, size_t N>
size_t tuw::StateNestedArray< SubState, N >::stateSize ( ) const
inlineoverridevirtual

Size of the sub-states.

Reimplemented from tuw::State.

Definition at line 106 of file state_nested_array.h.

template<typename SubState, size_t N>
void tuw::StateNestedArray< SubState, N >::updateSize ( )
inlineoverridevirtual

Performs internal manipulation when any of the underlying arrays are being resized.

Reimplemented from tuw::State.

Definition at line 142 of file state_nested_array.h.

template<typename SubState, size_t N>
double& tuw::StateNestedArray< SubState, N >::value ( const std::size_t &  _i)
inlineoverridevirtual

Access state variable based on index _i.

Implements tuw::State.

Definition at line 118 of file state_nested_array.h.

template<typename SubState, size_t N>
const double& tuw::StateNestedArray< SubState, N >::value ( const std::size_t &  _i) const
inlineoverridevirtual

Const access state variable based on index _i.

Implements tuw::State.

Definition at line 124 of file state_nested_array.h.

template<typename SubState, size_t N>
size_t tuw::StateNestedArray< SubState, N >::valueSize ( ) const
inlineoverridevirtual

Size of the state variables.

Implements tuw::State.

Definition at line 112 of file state_nested_array.h.

Member Data Documentation

template<typename SubState, size_t N>
std::array<std::shared_ptr<SubState>, N> tuw::StateNestedArray< SubState, N >::states_
protected

Definition at line 170 of file state_nested_array.h.

template<typename SubState, size_t N>
std::array<StateSPtr, N> tuw::StateNestedArray< SubState, N >::statesBase_
protected

Definition at line 173 of file state_nested_array.h.

template<typename SubState, size_t N>
size_t tuw::StateNestedArray< SubState, N >::statesSize_
protected

Definition at line 167 of file state_nested_array.h.

template<typename SubState, size_t N>
std::vector<double*> tuw::StateNestedArray< SubState, N >::values_
protected

Definition at line 176 of file state_nested_array.h.

template<typename SubState, size_t N>
size_t tuw::StateNestedArray< SubState, N >::valueSize_
protected

Definition at line 164 of file state_nested_array.h.


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


tuw_control
Author(s): George Todoran
autogenerated on Mon Jun 10 2019 15:27:23