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

Extension of StateArray providing value access based on a scoped enumeration (compile-time). More...

#include <state_array.hpp>

Inheritance diagram for tuw::StateArrayScoped< EnumStateVals >:
Inheritance graph
[legend]

Public Member Functions

virtual StateSPtr cloneState () const override
 Clone-to-base-class-ptr function. More...
 
std::shared_ptr< StateArrayScoped< EnumStateVals > > cloneStateExt () const
 Clone-to-this-class-ptr function. More...
 
StateArrayScopedoperator= (const StateArrayScoped &)=default
 
StateArrayScopedoperator= (StateArrayScoped &&)=default
 
 StateArrayScoped (State *_parent)
 
 StateArrayScoped ()
 
 StateArrayScoped (const StateArrayScoped &)=default
 
 StateArrayScoped (StateArrayScoped &&)=default
 
template<EnumStateVals _i>
double & value ()
 Scoped access (compile-time) to the values of the state object. More...
 
template<EnumStateVals _i>
const double & value () const
 Const scoped access (compile-time) to the values of the state object. More...
 
virtual ~StateArrayScoped ()=default
 
- Public Member Functions inherited from tuw::StateArray< asInt(EnumStateVals::ENUM_SIZE)>
StateArrayoperator= (const StateArray &)=default
 
StateArrayoperator= (StateArray &&)=default
 
 StateArray (State *_parent)
 
 StateArray ()
 
 StateArray (const StateArray &)=default
 
 StateArray (StateArray &&)=default
 
virtual double & value (const std::size_t &_i) override
 Access state variable based on index _i. More...
 
virtual const double & value (const std::size_t &_i) const override
 Const access state variable based on index _i. More...
 
std::array< double, N > & valuesArray ()
 Reference to the state variables array. More...
 
const std::array< double, N > & valuesArray () const
 Const reference to the variables array. More...
 
virtual size_t valueSize () const override
 Size of the state variables. More...
 
virtual ~StateArray ()=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
 
virtual StateSPtrstate (const std::size_t &_i)
 Access sub-state based on index _i. More...
 
virtual size_t stateSize () const
 Size of the sub-states. More...
 
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 void updateSize ()
 Performs internal manipulation when any of the underlying arrays are being resized. More...
 
virtual ~State ()=default
 

Friends

template<typename... NestedStates1>
class StateNestedSet
 
template<typename EnumStateVals1 , typename... NestedStates1>
class StateNestedSetScoped
 
template<typename SubState >
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::StateArray< asInt(EnumStateVals::ENUM_SIZE)>
std::array< double, N > values_
 State array container. More...
 
- Protected Attributes inherited from tuw::State
Stateparent_
 Pointer to the parent State structure. More...
 

Detailed Description

template<typename EnumStateVals>
class tuw::StateArrayScoped< EnumStateVals >

Extension of StateArray providing value 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.

Definition at line 138 of file state_array.hpp.

Constructor & Destructor Documentation

template<typename EnumStateVals>
tuw::StateArrayScoped< EnumStateVals >::StateArrayScoped ( State _parent)
inline

Definition at line 142 of file state_array.hpp.

template<typename EnumStateVals>
tuw::StateArrayScoped< EnumStateVals >::StateArrayScoped ( )
inline

Definition at line 147 of file state_array.hpp.

template<typename EnumStateVals>
virtual tuw::StateArrayScoped< EnumStateVals >::~StateArrayScoped ( )
virtualdefault
template<typename EnumStateVals>
tuw::StateArrayScoped< EnumStateVals >::StateArrayScoped ( const StateArrayScoped< EnumStateVals > &  )
default
template<typename EnumStateVals>
tuw::StateArrayScoped< EnumStateVals >::StateArrayScoped ( StateArrayScoped< EnumStateVals > &&  )
default

Member Function Documentation

template<typename EnumStateVals>
virtual StateSPtr tuw::StateArrayScoped< EnumStateVals >::cloneState ( ) const
inlineoverridevirtual

Clone-to-base-class-ptr function.

Reimplemented from tuw::StateArray< asInt(EnumStateVals::ENUM_SIZE)>.

Definition at line 168 of file state_array.hpp.

template<typename EnumStateVals>
std::shared_ptr<StateArrayScoped<EnumStateVals> > tuw::StateArrayScoped< EnumStateVals >::cloneStateExt ( ) const
inline

Clone-to-this-class-ptr function.

Definition at line 174 of file state_array.hpp.

template<typename EnumStateVals>
StateArrayScoped& tuw::StateArrayScoped< EnumStateVals >::operator= ( const StateArrayScoped< EnumStateVals > &  )
default
template<typename EnumStateVals>
StateArrayScoped& tuw::StateArrayScoped< EnumStateVals >::operator= ( StateArrayScoped< EnumStateVals > &&  )
default
template<typename EnumStateVals>
template<EnumStateVals _i>
double& tuw::StateArrayScoped< EnumStateVals >::value ( )
inline

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

Definition at line 181 of file state_array.hpp.

template<typename EnumStateVals>
template<EnumStateVals _i>
const double& tuw::StateArrayScoped< EnumStateVals >::value ( ) const
inline

Const scoped access (compile-time) to the values of the state object.

Definition at line 188 of file state_array.hpp.

Friends And Related Function Documentation

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

Definition at line 200 of file state_array.hpp.

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

Definition at line 202 of file state_array.hpp.

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

Definition at line 204 of file state_array.hpp.


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