Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
tuw::StateNestedSet< NestedStates > Class Template Reference

Implementation of State being formed by tuple of substates. More...

#include <state_nested_set.h>

Inheritance diagram for tuw::StateNestedSet< NestedStates >:
Inheritance graph
[legend]

Public Member Functions

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
 

Protected Attributes

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

static constexpr const size_t statesSize_ = sizeof...(NestedStates)
 

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... NestedStates>
class tuw::StateNestedSet< NestedStates >

Implementation of State being formed by tuple of substates.

Implementation of State being formed by a vector (variable size) of sub-states.

Template Parameters
NestedStatesParameter pack of the underlying substates types.
SubStateType of state defining the sub-states of the object.

Definition at line 49 of file state_nested_set.h.

Constructor & Destructor Documentation

template<typename... NestedStates>
tuw::StateNestedSet< NestedStates >::StateNestedSet ( State _parent)
inline

Definition at line 63 of file state_nested_set.h.

template<typename... NestedStates>
tuw::StateNestedSet< NestedStates >::StateNestedSet ( )
inline

Definition at line 72 of file state_nested_set.h.

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

Member Function Documentation

template<typename... NestedStates>
virtual StateSPtr tuw::StateNestedSet< NestedStates >::cloneState ( ) const
inlineoverridevirtual

Clone-to-base-class-ptr function.

Implements tuw::State.

Definition at line 96 of file state_nested_set.h.

template<typename... NestedStates>
StateNestedSet& tuw::StateNestedSet< NestedStates >::operator= ( const StateNestedSet< NestedStates > &  )
default
template<typename... NestedStates>
StateNestedSet& tuw::StateNestedSet< NestedStates >::operator= ( StateNestedSet< NestedStates > &&  )
default
template<typename... NestedStates>
StateSPtr& tuw::StateNestedSet< NestedStates >::state ( const std::size_t &  _i)
inlineoverridevirtual

Access sub-state based on index _i.

Reimplemented from tuw::State.

Definition at line 126 of file state_nested_set.h.

template<typename... NestedStates>
size_t tuw::StateNestedSet< NestedStates >::stateSize ( ) const
inlineoverridevirtual

Size of the sub-states.

Reimplemented from tuw::State.

Definition at line 102 of file state_nested_set.h.

template<typename... NestedStates>
void tuw::StateNestedSet< NestedStates >::updateSize ( )
inlineoverridevirtual

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

Reimplemented from tuw::State.

Definition at line 132 of file state_nested_set.h.

template<typename... NestedStates>
double& tuw::StateNestedSet< NestedStates >::value ( const std::size_t &  _i)
inlineoverridevirtual

Access state variable based on index _i.

Implements tuw::State.

Definition at line 114 of file state_nested_set.h.

template<typename... NestedStates>
const double& tuw::StateNestedSet< NestedStates >::value ( const std::size_t &  _i) const
inlineoverridevirtual

Const access state variable based on index _i.

Implements tuw::State.

Definition at line 120 of file state_nested_set.h.

template<typename... NestedStates>
size_t tuw::StateNestedSet< NestedStates >::valueSize ( ) const
inlineoverridevirtual

Size of the state variables.

Implements tuw::State.

Definition at line 108 of file state_nested_set.h.

Member Data Documentation

template<typename... NestedStates>
bool tuw::StateNestedSet< NestedStates >::isInit_
protected

Definition at line 177 of file state_nested_set.h.

template<typename... NestedStates>
std::tuple<std::shared_ptr<NestedStates>...> tuw::StateNestedSet< NestedStates >::states_
protected

Definition at line 168 of file state_nested_set.h.

template<typename... NestedStates>
std::vector<StateSPtr> tuw::StateNestedSet< NestedStates >::statesBase_
protected

Definition at line 171 of file state_nested_set.h.

template<typename... NestedStates>
constexpr const size_t tuw::StateNestedSet< NestedStates >::statesSize_ = sizeof...(NestedStates)
staticprotected

Definition at line 165 of file state_nested_set.h.

template<typename... NestedStates>
std::vector<double*> tuw::StateNestedSet< NestedStates >::values_
protected

Definition at line 174 of file state_nested_set.h.

template<typename... NestedStates>
size_t tuw::StateNestedSet< NestedStates >::valueSize_
protected

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