Aikido
|
Wrap a State with its StateSpace to provide convenient accessor methods. More...
#include <aikido/statespace/StateHandle.hpp>
Public Types | |
using | StateSpace = _StateSpace |
using | QualifiedState = _QualifiedState |
using | State = typename StateSpace::State |
using | ConstState = typename std::conditional< std::is_const< QualifiedState >::value, QualifiedState, const QualifiedState >::type |
Public Member Functions | |
StateHandle () | |
Constructs a nullptr handle. More... | |
StateHandle (const StateSpace *space, QualifiedState *state) | |
Wrap state, which must be form the provided StateSpace. More... | |
StateHandle (const StateHandle &)=default | |
StateHandle (StateHandle &&)=default | |
StateHandle & | operator= (StateHandle &&)=default |
StateHandle & | operator= (const StateHandle &)=default |
operator QualifiedState * () const | |
Implicitly convert to a State pointer. More... | |
void | reset () |
Resets StateHandle to nullptr. More... | |
void | reset (const StateSpace *space, QualifiedState *state) |
Resets the state, which must be from the provided StateSpace. More... | |
template<typename Q = QualifiedState> | |
auto | getState () -> typename std::enable_if<!std::is_const< Q >::value, Q * >::type |
Returns the State. More... | |
template<typename Q = QualifiedState> | |
auto | getState () const -> typename std::conditional< std::is_const< Q >::value, Q *, const Q * >::type |
Returns the State. More... | |
const StateSpace * | getStateSpace () const |
Returns the state space that created this state. More... | |
Protected Attributes | |
const StateSpace * | mSpace |
State space of the sate that is managed by this handler. More... | |
QualifiedState * | mState |
State managed by this handler. This can be either const or non-const type. More... | |
Wrap a State with its StateSpace to provide convenient accessor methods.
The template parameter _QualifiedState
is necessary to support both const
and non-const
states.
_StateSpace | Type of StateSpace this state is a member of |
_QualifiedState | Type of State being wrapped |
using aikido::statespace::StateHandle< _StateSpace, _QualifiedState >::ConstState = typename std::conditional< std::is_const<QualifiedState>::value, QualifiedState, const QualifiedState>::type |
using aikido::statespace::StateHandle< _StateSpace, _QualifiedState >::QualifiedState = _QualifiedState |
using aikido::statespace::StateHandle< _StateSpace, _QualifiedState >::State = typename StateSpace::State |
using aikido::statespace::StateHandle< _StateSpace, _QualifiedState >::StateSpace = _StateSpace |
aikido::statespace::StateHandle< StateSpace, QualifiedState >::StateHandle |
Constructs a nullptr handle.
aikido::statespace::StateHandle< StateSpace, QualifiedState >::StateHandle | ( | const StateSpace * | space, |
QualifiedState * | state | ||
) |
Wrap state, which must be form the provided StateSpace.
space | State space that created state . |
state | State created by space . |
|
default |
|
default |
auto aikido::statespace::StateHandle< StateSpace, QualifiedState >::getState |
Returns the State.
This function is enabled only if QualifiedState is a non-const State type.
auto aikido::statespace::StateHandle< _StateSpace, _QualifiedState >::getState | ( | ) | const -> typename std::conditional< std::is_const< Q >::value, Q *, const Q * >::type |
Returns the State.
auto aikido::statespace::StateHandle< _StateSpace, _QualifiedState >::getStateSpace |
Returns the state space that created this state.
aikido::statespace::StateHandle< StateSpace, QualifiedState >::operator QualifiedState * |
Implicitly convert to a State
pointer.
|
default |
|
default |
void aikido::statespace::StateHandle< StateSpace, QualifiedState >::reset |
Resets StateHandle to nullptr.
void aikido::statespace::StateHandle< StateSpace, QualifiedState >::reset | ( | const StateSpace * | space, |
QualifiedState * | state | ||
) |
Resets the state, which must be from the provided StateSpace.
space | State space that created state . |
state | State created by space . |
|
protected |
State space of the sate that is managed by this handler.
|
protected |
State managed by this handler. This can be either const or non-const type.