DART  6.10.1
dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState > Class Template Reference

#include <EmbeddedAspect.hpp>

Inheritance diagram for dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >:

Classes

struct  ConvertIfState
 Used to identify constructor arguments that can be used as a State. More...
 

Public Types

enum  DelegateTag { Delegate }
 
using Base = BaseT
 
using Derived = DerivedT
 
using State = StateT
 
using StateData = StateDataT
 

Public Member Functions

 EmbeddedStateAspect (const EmbeddedStateAspect &)=delete
 
virtual ~EmbeddedStateAspect ()=default
 
 EmbeddedStateAspect ()
 Construct this Aspect without affecting the State. More...
 
template<typename T , typename... RemainingArgs>
 EmbeddedStateAspect (const T &arg1, RemainingArgs &&... remainingArgs)
 Construct this Aspect. More...
 
void setAspectState (const Aspect::State &state) override final
 
void setState (const State &state)
 Set the State of this Aspect. More...
 
const Aspect::StategetAspectState () const override final
 
const StategetState () const
 Get the State of this Aspect. More...
 
std::unique_ptr< AspectcloneAspect () const override
 

Static Public Attributes

constexpr static void(* SetEmbeddedState )(Derived *, const State &) = setEmbeddedState
 
constexpr static const State &(* GetEmbeddedState )(const Derived *) = getEmbeddedState
 

Protected Member Functions

template<typename... RemainingArgs>
 EmbeddedStateAspect (DelegateTag, const StateData &state, RemainingArgs &&... remainingArgs)
 Construct this Aspect using the StateData, and pass the remaining arguments into the constructor of the Base class. More...
 
template<typename... BaseArgs>
 EmbeddedStateAspect (DelegateTag, BaseArgs &&... args)
 Construct this Aspect without affecting the State, and pass all the arguments into the constructor of the Base class. More...
 
void setComposite (Composite *newComposite) override
 Pass the temporary State of this Aspect into the new Composite. More...
 
void loseComposite (Composite *oldComposite) override
 Save the embedded State of this Composite before we remove the Aspect. More...
 

Protected Attributes

std::unique_ptr< StatemTemporaryState
 After this Aspect is constructed and during transitions between Composite objects, this will hold the State of the Aspect. More...
 

Member Typedef Documentation

◆ Base

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
using dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::Base = BaseT

◆ Derived

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
using dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::Derived = DerivedT

◆ State

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
using dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::State = StateT

◆ StateData

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
using dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::StateData = StateDataT

Member Enumeration Documentation

◆ DelegateTag

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
enum dart::common::detail::EmbeddedStateAspect::DelegateTag
Enumerator
Delegate 

Constructor & Destructor Documentation

◆ EmbeddedStateAspect() [1/5]

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::EmbeddedStateAspect ( const EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState > &  )
delete

◆ ~EmbeddedStateAspect()

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
virtual dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::~EmbeddedStateAspect ( )
virtualdefault

◆ EmbeddedStateAspect() [2/5]

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::EmbeddedStateAspect ( )
inline

Construct this Aspect without affecting the State.

◆ EmbeddedStateAspect() [3/5]

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
template<typename T , typename... RemainingArgs>
dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::EmbeddedStateAspect ( const T &  arg1,
RemainingArgs &&...  remainingArgs 
)
inline

Construct this Aspect.

If the first argument contains StateData, then it will be used by this Aspect. Otherwise, all arguments will be forwarded to the Base class.

◆ EmbeddedStateAspect() [4/5]

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
template<typename... RemainingArgs>
dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::EmbeddedStateAspect ( DelegateTag  ,
const StateData state,
RemainingArgs &&...  remainingArgs 
)
inlineprotected

Construct this Aspect using the StateData, and pass the remaining arguments into the constructor of the Base class.

◆ EmbeddedStateAspect() [5/5]

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
template<typename... BaseArgs>
dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::EmbeddedStateAspect ( DelegateTag  ,
BaseArgs &&...  args 
)
inlineprotected

Construct this Aspect without affecting the State, and pass all the arguments into the constructor of the Base class.

Member Function Documentation

◆ cloneAspect()

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
std::unique_ptr<Aspect> dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::cloneAspect ( ) const
inlineoverride

◆ getAspectState()

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
const Aspect::State* dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::getAspectState ( ) const
inlinefinaloverride

◆ getState()

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
const State& dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::getState ( ) const
inline

Get the State of this Aspect.

◆ loseComposite()

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
void dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::loseComposite ( Composite oldComposite)
inlineoverrideprotected

◆ setAspectState()

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
void dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::setAspectState ( const Aspect::State state)
inlinefinaloverride

◆ setComposite()

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
void dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::setComposite ( Composite newComposite)
inlineoverrideprotected

◆ setState()

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
void dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::setState ( const State state)
inline

Set the State of this Aspect.

Member Data Documentation

◆ GetEmbeddedState

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
constexpr static const State&(* dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::GetEmbeddedState) (const Derived *) = getEmbeddedState
staticconstexpr

◆ mTemporaryState

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
std::unique_ptr<State> dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::mTemporaryState
protected

After this Aspect is constructed and during transitions between Composite objects, this will hold the State of the Aspect.

Once the Aspect has been moved into a new Composite, this State will be pushed into the Composite and cleared.

◆ SetEmbeddedState

template<class BaseT , class DerivedT , typename StateDataT , typename StateT = common::Aspect::MakeState<StateDataT>, void(*)(DerivedT *, const StateT &) setEmbeddedState = &DefaultSetEmbeddedState<DerivedT, StateT>, const StateT &(*)(const DerivedT *) getEmbeddedState = &DefaultGetEmbeddedState<DerivedT, StateT>>
constexpr static void(* dart::common::detail::EmbeddedStateAspect< BaseT, DerivedT, StateDataT, StateT, setEmbeddedState, getEmbeddedState >::SetEmbeddedState) (Derived *, const State &) = setEmbeddedState
staticconstexpr