Public Member Functions | List of all members
tuw::StateNestedSetScoped< EnumStateVals, NestedStates > Class Template Reference

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

#include <state_nested_set.h>

Inheritance diagram for tuw::StateNestedSetScoped< EnumStateVals, NestedStates >:
Inheritance graph
[legend]

Public Member Functions

StateNestedSetScopedoperator= (const StateNestedSetScoped &)=default
 
StateNestedSetScopedoperator= (StateNestedSetScoped &&)=default
 
template<EnumStateVals _i>
std::tuple_element< asInt(_i), std::tuple< std::shared_ptr< NestedStates >... > >::type & state ()
 Scoped access (compile-time) to the sub-states of the state object. More...
 
 StateNestedSetScoped (State *_parent)
 
 StateNestedSetScoped ()
 
 StateNestedSetScoped (const StateNestedSetScoped &)=default
 
 StateNestedSetScoped (StateNestedSetScoped &&)=default
 
virtual ~StateNestedSetScoped ()=default
 
- Public Member Functions inherited from tuw::StateNestedSet< NestedStates... >
virtual StateSPtr cloneState () const override
 Clone-to-base-class-ptr function. More...
 
StateNestedSetoperator= (const StateNestedSet &)=default
 
StateNestedSetoperator= (StateNestedSet &&)=default
 
StateSPtrstate (const std::size_t &_i) override
 Access sub-state based on index _i. More...
 
 StateNestedSet (State *_parent)
 
 StateNestedSet ()
 
 StateNestedSet (const StateNestedSet &)=default
 
 StateNestedSet (StateNestedSet &&)=default
 
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 ~StateNestedSet ()=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
 

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::StateNestedSet< NestedStates... >
bool isInit_
 
std::tuple< std::shared_ptr< NestedStates >... > states_
 
std::vector< StateSPtrstatesBase_
 
std::vector< double * > values_
 
size_t valueSize_
 
- Protected Attributes inherited from tuw::State
Stateparent_
 Pointer to the parent State structure. More...
 
- Static Protected Attributes inherited from tuw::StateNestedSet< NestedStates... >
static constexpr const size_t statesSize_
 

Detailed Description

template<typename EnumStateVals, typename... NestedStates>
class tuw::StateNestedSetScoped< EnumStateVals, NestedStates >

Extension of StateNestedSet 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.
NestedStatesParameter pack of the underlying substates types.

Definition at line 187 of file state_nested_set.h.

Constructor & Destructor Documentation

template<typename EnumStateVals , typename... NestedStates>
tuw::StateNestedSetScoped< EnumStateVals, NestedStates >::StateNestedSetScoped ( State _parent)
inline

Definition at line 191 of file state_nested_set.h.

template<typename EnumStateVals , typename... NestedStates>
tuw::StateNestedSetScoped< EnumStateVals, NestedStates >::StateNestedSetScoped ( )
inline

Definition at line 196 of file state_nested_set.h.

template<typename EnumStateVals , typename... NestedStates>
virtual tuw::StateNestedSetScoped< EnumStateVals, NestedStates >::~StateNestedSetScoped ( )
virtualdefault
template<typename EnumStateVals , typename... NestedStates>
tuw::StateNestedSetScoped< EnumStateVals, NestedStates >::StateNestedSetScoped ( const StateNestedSetScoped< EnumStateVals, NestedStates > &  )
default
template<typename EnumStateVals , typename... NestedStates>
tuw::StateNestedSetScoped< EnumStateVals, NestedStates >::StateNestedSetScoped ( StateNestedSetScoped< EnumStateVals, NestedStates > &&  )
default

Member Function Documentation

template<typename EnumStateVals , typename... NestedStates>
StateNestedSetScoped& tuw::StateNestedSetScoped< EnumStateVals, NestedStates >::operator= ( const StateNestedSetScoped< EnumStateVals, NestedStates > &  )
default
template<typename EnumStateVals , typename... NestedStates>
StateNestedSetScoped& tuw::StateNestedSetScoped< EnumStateVals, NestedStates >::operator= ( StateNestedSetScoped< EnumStateVals, NestedStates > &&  )
default
template<typename EnumStateVals , typename... NestedStates>
template<EnumStateVals _i>
std::tuple_element<asInt(_i), std::tuple<std::shared_ptr<NestedStates>...> >::type& tuw::StateNestedSetScoped< EnumStateVals, NestedStates >::state ( )
inline

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

Definition at line 225 of file state_nested_set.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