dart
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
StatefulAspect< T > Class Template Reference
Inheritance diagram for StatefulAspect< T >:
Inheritance graph
[legend]
Collaboration diagram for StatefulAspect< T >:
Collaboration graph
[legend]

Classes

struct  Data
 

Public Types

using State = Aspect::MakeState< Data >
 
using Properties = Aspect::MakeProperties< Data >
 
- Public Types inherited from dart::common::Aspect
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

 StatefulAspect (const StatefulAspect &other)
 
 StatefulAspect (const T &state)
 
 StatefulAspect (const T &state, const T &properties)
 
std::unique_ptr< AspectcloneAspect () const override final
 Clone this Aspect into a new composite.
 
void setAspectState (const Aspect::State &otherState) override
 Set the State of this Aspect. By default, this does nothing.
 
const Aspect::StategetAspectState () const override
 Get the State of this Aspect. More...
 
void setAspectProperties (const Aspect::Properties &someProperties) override
 Set the Properties of this Aspect. By default, this does nothing.
 
const Aspect::PropertiesgetAspectProperties () const override
 Get the Properties of this Aspect. More...
 
void randomize ()
 
- Public Member Functions inherited from dart::common::Aspect
virtual ~Aspect ()=default
 Virtual destructor.
 
- Public Member Functions inherited from dart::common::Subject
virtual ~Subject ()
 Destructor will notify all Observers that it is destructing.
 

Public Attributes

State mState
 
Properties mProperties
 

Additional Inherited Members

- Protected Member Functions inherited from dart::common::Aspect
virtual void setComposite (Composite *newComposite)
 This function will be triggered (1) after the Aspect has been created [transfer will be false] and (2) after the Aspect has been transferred to a new Composite [transfer will be true]. More...
 
virtual void loseComposite (Composite *oldComposite)
 This function will be triggered if your Aspect is about to be removed from its Composite. More...
 
- Protected Member Functions inherited from dart::common::Subject
void sendDestructionNotification () const
 Send a destruction notification to all Observers. More...
 
void addObserver (Observer *_observer) const
 Add an Observer to the list of Observers.
 
void removeObserver (Observer *_observer) const
 Remove an Observer from the list of Observers.
 
- Protected Attributes inherited from dart::common::Subject
std::set< Observer * > mObservers
 List of current Observers.
 

Member Function Documentation

◆ getAspectProperties()

template<typename T >
const Aspect::Properties* StatefulAspect< T >::getAspectProperties ( ) const
inlineoverridevirtual

Get the Properties of this Aspect.

By default, this returns a nullptr which implies that the Aspect has no properties.

Reimplemented from dart::common::Aspect.

◆ getAspectState()

template<typename T >
const Aspect::State* StatefulAspect< T >::getAspectState ( ) const
inlineoverridevirtual

Get the State of this Aspect.

By default, this returns a nullptr which implies that the Aspect is stateless.

Reimplemented from dart::common::Aspect.


The documentation for this class was generated from the following file: