dart
|
This is the implementation of a standard embedded-state Aspect. More...
#include <EmbeddedAspect.hpp>
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 |
using | Base = CompositeTrackingAspect< CompositeT > |
using | Derived = EmbeddedStateAspect< CompositeT, StateDataT > |
using | State = common::Aspect::MakeState< StateDataT > |
using | StateData = StateDataT |
![]() | |
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) | |
![]() | |
EmbeddedStateAspect (const EmbeddedStateAspect &)=delete | |
EmbeddedStateAspect () | |
Construct this Aspect without affecting the State. | |
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. | |
const Aspect::State * | getAspectState () const override final |
const State & | getState () const |
Get the State of this Aspect. | |
std::unique_ptr< Aspect > | cloneAspect () const override |
![]() | |
CompositeTrackingAspect () | |
Default constructor. | |
CompositeT * | getComposite () |
Get the Composite of this Aspect. | |
const CompositeT * | getComposite () const |
Get the Composite of this Aspect. | |
bool | hasComposite () const |
Returns true if this Aspect has a Composite that matches CompositeType. | |
![]() | |
virtual | ~Aspect ()=default |
Virtual destructor. | |
virtual void | setAspectProperties (const Properties &someProperties) |
Set the Properties of this Aspect. By default, this does nothing. | |
virtual const Properties * | getAspectProperties () const |
Get the Properties of this Aspect. More... | |
Additional Inherited Members | |
![]() | |
static constexpr void(* | SetEmbeddedState )(Derived *, const State &) |
static constexpr const State &(* | GetEmbeddedState )(const Derived *) |
![]() | |
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... | |
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. | |
void | loseComposite (Composite *oldComposite) override |
Save the embedded State of this Composite before we remove the Aspect. | |
![]() | |
std::unique_ptr< State > | mTemporaryState |
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. | |
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.