DART  6.10.1
dart::common::EmbeddedStateAspect< CompositeT, StateDataT > Class Template Reference

This is the implementation of a standard embedded-state Aspect. More...

#include <EmbeddedAspect.hpp>

Inheritance diagram for dart::common::EmbeddedStateAspect< CompositeT, StateDataT >:
dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT >, EmbeddedStateAspect< CompositeT, StateDataT >, StateDataT > dart::common::CompositeTrackingAspect< CompositeT > dart::common::Aspect

Public Types

using Base = CompositeTrackingAspect< CompositeT >
 
using Derived = EmbeddedStateAspect< CompositeT, StateDataT >
 
using Impl = detail::EmbeddedStateAspect< Base, Derived, StateDataT >
 
using State = typename Impl::State
 
using StateData = typename Impl::StateData
 
enum  DelegateTag
 
template<class Mixin >
using MakeState = MakeCloneable< State, Mixin >
 Use the MakeState class to easily create a State extension from an existing class or struct. More...
 
template<class Mixin >
using MakeProperties = MakeCloneable< Properties, Mixin >
 Use the MakeProperties class to easily create a Properties extension from an existing class or struct. More...
 

Public Member Functions

template<typename... Args>
 EmbeddedStateAspect (Args &&... args)
 
virtual ~EmbeddedStateAspect ()=default
 
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
 
CompositeT * getComposite ()
 Get the Composite of this Aspect. More...
 
const CompositeT * getComposite () const
 Get the Composite of this Aspect. More...
 
bool hasComposite () const
 Returns true if this Aspect has a Composite that matches CompositeType. More...
 
virtual void setAspectProperties (const Properties &someProperties)
 Set the Properties of this Aspect. By default, this does nothing. More...
 
virtual const PropertiesgetAspectProperties () const
 Get the Properties of this Aspect. More...
 

Static Public Attributes

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

Protected Member Functions

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...
 
CompositeT * mComposite
 Pointer to the current Composite of this Aspect. More...
 

Detailed Description

template<class CompositeT, typename StateDataT>
class dart::common::EmbeddedStateAspect< CompositeT, StateDataT >

This is the implementation of a standard embedded-state Aspect.

Inherit the EmbedState class (next class down in the header) to use this Aspect implementation.

For more control over how your embedded-state Aspect is implemented, you can use the detail::EmbeddedStateAspect class.

Member Typedef Documentation

◆ Base

template<class CompositeT , typename StateDataT >
using dart::common::EmbeddedStateAspect< CompositeT, StateDataT >::Base = CompositeTrackingAspect<CompositeT>

◆ Derived

template<class CompositeT , typename StateDataT >
using dart::common::EmbeddedStateAspect< CompositeT, StateDataT >::Derived = EmbeddedStateAspect<CompositeT, StateDataT>

◆ Impl

template<class CompositeT , typename StateDataT >
using dart::common::EmbeddedStateAspect< CompositeT, StateDataT >::Impl = detail::EmbeddedStateAspect<Base, Derived, StateDataT>

◆ MakeProperties

template<class Mixin >
using dart::common::Aspect::MakeProperties = MakeCloneable<Properties, Mixin>
inherited

Use the MakeProperties class to easily create a Properties extension from an existing class or struct.

◆ MakeState

template<class Mixin >
using dart::common::Aspect::MakeState = MakeCloneable<State, Mixin>
inherited

Use the MakeState class to easily create a State extension from an existing class or struct.

◆ State

template<class CompositeT , typename StateDataT >
using dart::common::EmbeddedStateAspect< CompositeT, StateDataT >::State = typename Impl::State

◆ StateData

template<class CompositeT , typename StateDataT >
using dart::common::EmbeddedStateAspect< CompositeT, StateDataT >::StateData = typename Impl::StateData

Member Enumeration Documentation

◆ DelegateTag

Constructor & Destructor Documentation

◆ EmbeddedStateAspect()

template<class CompositeT , typename StateDataT >
template<typename... Args>
dart::common::EmbeddedStateAspect< CompositeT, StateDataT >::EmbeddedStateAspect ( Args &&...  args)
inline

◆ ~EmbeddedStateAspect()

template<class CompositeT , typename StateDataT >
virtual dart::common::EmbeddedStateAspect< CompositeT, StateDataT >::~EmbeddedStateAspect ( )
virtualdefault

Member Function Documentation

◆ cloneAspect()

std::unique_ptr<Aspect> dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT > , EmbeddedStateAspect< CompositeT, StateDataT > , StateDataT, common::Aspect::MakeState<StateDataT> , &DefaultSetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > , &DefaultGetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > >::cloneAspect ( ) const
inlineoverridevirtualinherited

Implements dart::common::Aspect.

◆ getAspectProperties()

◆ getAspectState()

const Aspect::State* dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT > , EmbeddedStateAspect< CompositeT, StateDataT > , StateDataT, common::Aspect::MakeState<StateDataT> , &DefaultSetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > , &DefaultGetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > >::getAspectState ( ) const
inlinefinaloverridevirtualinherited

Reimplemented from dart::common::Aspect.

◆ getComposite() [1/2]

CompositeT * dart::common::CompositeTrackingAspect< CompositeT >::getComposite
inherited

Get the Composite of this Aspect.

◆ getComposite() [2/2]

const CompositeT * dart::common::CompositeTrackingAspect< CompositeT >::getComposite
inherited

Get the Composite of this Aspect.

◆ getState()

const State& dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT > , EmbeddedStateAspect< CompositeT, StateDataT > , StateDataT, common::Aspect::MakeState<StateDataT> , &DefaultSetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > , &DefaultGetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > >::getState ( ) const
inlineinherited

Get the State of this Aspect.

◆ hasComposite()

bool dart::common::CompositeTrackingAspect< CompositeT >::hasComposite
inherited

Returns true if this Aspect has a Composite that matches CompositeType.

◆ loseComposite()

void dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT > , EmbeddedStateAspect< CompositeT, StateDataT > , StateDataT, common::Aspect::MakeState<StateDataT> , &DefaultSetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > , &DefaultGetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > >::loseComposite ( Composite oldComposite)
inlineoverrideprotectedvirtualinherited

Save the embedded State of this Composite before we remove the Aspect.

Reimplemented from dart::common::CompositeTrackingAspect< CompositeT >.

◆ setAspectProperties()

◆ setAspectState()

void dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT > , EmbeddedStateAspect< CompositeT, StateDataT > , StateDataT, common::Aspect::MakeState<StateDataT> , &DefaultSetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > , &DefaultGetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > >::setAspectState ( const Aspect::State otherState)
inlinefinaloverridevirtualinherited

Reimplemented from dart::common::Aspect.

◆ setComposite()

void dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT > , EmbeddedStateAspect< CompositeT, StateDataT > , StateDataT, common::Aspect::MakeState<StateDataT> , &DefaultSetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > , &DefaultGetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > >::setComposite ( Composite newComposite)
inlineoverrideprotectedvirtualinherited

Pass the temporary State of this Aspect into the new Composite.

Reimplemented from dart::common::CompositeTrackingAspect< CompositeT >.

◆ setState()

void dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT > , EmbeddedStateAspect< CompositeT, StateDataT > , StateDataT, common::Aspect::MakeState<StateDataT> , &DefaultSetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > , &DefaultGetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > >::setState ( const State state)
inlineinherited

Set the State of this Aspect.

Member Data Documentation

◆ GetEmbeddedState

constexpr static const State&(* dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT > , EmbeddedStateAspect< CompositeT, StateDataT > , StateDataT, common::Aspect::MakeState<StateDataT> , &DefaultSetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > , &DefaultGetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > >::GetEmbeddedState) (const Derived *)
staticconstexprinherited

◆ mComposite

CompositeT * dart::common::CompositeTrackingAspect< CompositeT >::mComposite
protectedinherited

Pointer to the current Composite of this Aspect.

◆ mTemporaryState

std::unique_ptr<State> dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT > , EmbeddedStateAspect< CompositeT, StateDataT > , StateDataT, common::Aspect::MakeState<StateDataT> , &DefaultSetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > , &DefaultGetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > >::mTemporaryState
protectedinherited

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

constexpr static void(* dart::common::detail::EmbeddedStateAspect< CompositeTrackingAspect< CompositeT > , EmbeddedStateAspect< CompositeT, StateDataT > , StateDataT, common::Aspect::MakeState<StateDataT> , &DefaultSetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > , &DefaultGetEmbeddedState<EmbeddedStateAspect< CompositeT, StateDataT > , common::Aspect::MakeState<StateDataT> > >::SetEmbeddedState) (Derived *, const State &)
staticconstexprinherited