Public Member Functions | Friends | List of all members
tuw::StateNestedArrayScoped< EnumStateVals, SubState > Class Template Reference

Extension of StateNestedArray providing sub-state access based on a scoped enumeration (compile-time). More...

#include <state_nested_array.h>

Inheritance diagram for tuw::StateNestedArrayScoped< EnumStateVals, SubState >:
Inheritance graph
[legend]

Public Member Functions

virtual StateSPtr cloneState () const override
 Clone-to-base-class-ptr function. More...
 
std::shared_ptr< StateNestedArrayScoped< EnumStateVals, SubState > > cloneStateExt () const
 Clone-to-this-class-ptr function. More...
 
StateNestedArrayScopedoperator= (const StateNestedArrayScoped &)=default
 
StateNestedArrayScopedoperator= (StateNestedArrayScoped &&)=default
 
template<EnumStateVals _i>
std::shared_ptr< SubState > & state ()
 Scoped access (compile-time) to the sub-states of the state object. More...
 
 StateNestedArrayScoped (State *_parent)
 
 StateNestedArrayScoped ()
 
 StateNestedArrayScoped (const StateNestedArrayScoped &)=default
 
 StateNestedArrayScoped (StateNestedArrayScoped &&)=default
 
virtual ~StateNestedArrayScoped ()=default
 
- Public Member Functions inherited from tuw::StateNestedArray< SubState, asInt(EnumStateVals::ENUM_SIZE)>
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
 

Friends

template<typename... NestedStates1>
class StateNestedSet
 
template<typename EnumStateVals1 , typename... NestedStates1>
class StateNestedSetScoped
 
template<typename SubState1 >
class StateNestedVector
 

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...
 
- Protected Attributes inherited from tuw::StateNestedArray< SubState, asInt(EnumStateVals::ENUM_SIZE)>
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...
 

Detailed Description

template<typename EnumStateVals, typename SubState>
class tuw::StateNestedArrayScoped< EnumStateVals, SubState >

Extension of StateNestedArray providing sub-state access based on a scoped enumeration (compile-time).

Template Parameters
EnumStateValsScoped enumeration that defines semantic access to the values of the state array. Has to have ENUM_SIZE representing the number of enum values.
SubStateType of state defining the sub-states of the object.

Definition at line 186 of file state_nested_array.h.

Constructor & Destructor Documentation

template<typename EnumStateVals , typename SubState >
tuw::StateNestedArrayScoped< EnumStateVals, SubState >::StateNestedArrayScoped ( State _parent)
inline

Definition at line 190 of file state_nested_array.h.

template<typename EnumStateVals , typename SubState >
tuw::StateNestedArrayScoped< EnumStateVals, SubState >::StateNestedArrayScoped ( )
inline

Definition at line 195 of file state_nested_array.h.

template<typename EnumStateVals , typename SubState >
virtual tuw::StateNestedArrayScoped< EnumStateVals, SubState >::~StateNestedArrayScoped ( )
virtualdefault
template<typename EnumStateVals , typename SubState >
tuw::StateNestedArrayScoped< EnumStateVals, SubState >::StateNestedArrayScoped ( const StateNestedArrayScoped< EnumStateVals, SubState > &  )
default
template<typename EnumStateVals , typename SubState >
tuw::StateNestedArrayScoped< EnumStateVals, SubState >::StateNestedArrayScoped ( StateNestedArrayScoped< EnumStateVals, SubState > &&  )
default

Member Function Documentation

template<typename EnumStateVals , typename SubState >
virtual StateSPtr tuw::StateNestedArrayScoped< EnumStateVals, SubState >::cloneState ( ) const
inlineoverridevirtual

Clone-to-base-class-ptr function.

Reimplemented from tuw::StateNestedArray< SubState, asInt(EnumStateVals::ENUM_SIZE)>.

Definition at line 216 of file state_nested_array.h.

template<typename EnumStateVals , typename SubState >
std::shared_ptr<StateNestedArrayScoped<EnumStateVals, SubState> > tuw::StateNestedArrayScoped< EnumStateVals, SubState >::cloneStateExt ( ) const
inline

Clone-to-this-class-ptr function.

Definition at line 222 of file state_nested_array.h.

template<typename EnumStateVals , typename SubState >
StateNestedArrayScoped& tuw::StateNestedArrayScoped< EnumStateVals, SubState >::operator= ( const StateNestedArrayScoped< EnumStateVals, SubState > &  )
default
template<typename EnumStateVals , typename SubState >
StateNestedArrayScoped& tuw::StateNestedArrayScoped< EnumStateVals, SubState >::operator= ( StateNestedArrayScoped< EnumStateVals, SubState > &&  )
default
template<typename EnumStateVals , typename SubState >
template<EnumStateVals _i>
std::shared_ptr<SubState>& tuw::StateNestedArrayScoped< EnumStateVals, SubState >::state ( )
inline

Scoped access (compile-time) to the sub-states of the state object.

Definition at line 233 of file state_nested_array.h.

Friends And Related Function Documentation

template<typename EnumStateVals , typename SubState >
template<typename... NestedStates1>
friend class StateNestedSet
friend

Definition at line 245 of file state_nested_array.h.

template<typename EnumStateVals , typename SubState >
template<typename EnumStateVals1 , typename... NestedStates1>
friend class StateNestedSetScoped
friend

Definition at line 247 of file state_nested_array.h.

template<typename EnumStateVals , typename SubState >
template<typename SubState1 >
friend class StateNestedVector
friend

Definition at line 249 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