33 #ifndef DART_COMMON_ASPECT_HPP_
34 #define DART_COMMON_ASPECT_HPP_
70 template <
class Mixin>
91 template <
class Mixin>
130 template <
class CompositeType>
161 #define DART_COMMON_ASPECT_PROPERTY_CONSTRUCTOR( \
162 ClassName, UpdatePropertiesMacro) \
163 ClassName(const ClassName&) = delete; \
164 inline ClassName(const PropertiesData& properties = PropertiesData()) \
165 : AspectWithVersionedProperties< \
170 UpdatePropertiesMacro>(properties) \
175 #define DART_COMMON_ASPECT_STATE_PROPERTY_CONSTRUCTORS(ClassName) \
176 ClassName(const ClassName&) = delete; \
178 const StateData& state = StateData(), \
179 const PropertiesData& properties = PropertiesData()) \
180 : AspectImpl(state, properties) \
184 const PropertiesData& properties, const StateData state = StateData()) \
185 : AspectImpl(properties, state) \
190 #define DART_COMMON_SET_ASPECT_PROPERTY_CUSTOM(Type, Name, Update) \
191 inline void set##Name(const Type& value) \
193 mProperties.m##Name = value; \
198 #define DART_COMMON_SET_ASPECT_PROPERTY(Type, Name) \
199 DART_COMMON_SET_ASPECT_PROPERTY_CUSTOM(Type, Name, notifyPropertiesUpdated)
202 #define DART_COMMON_GET_ASPECT_PROPERTY(Type, Name) \
203 inline const Type& get##Name() const \
205 return mProperties.m##Name; \
209 #define DART_COMMON_SET_GET_ASPECT_PROPERTY(Type, Name) \
210 DART_COMMON_SET_ASPECT_PROPERTY(Type, Name) \
211 DART_COMMON_GET_ASPECT_PROPERTY(Type, Name)
If your Aspect has Properties, then that Properties class should inherit this Aspect::Properties clas...
Definition: Aspect.hpp:86
If your Aspect has a State, then that State class should inherit this Aspect::State class.
Definition: Aspect.hpp:65
Definition: Aspect.hpp:48
virtual std::unique_ptr< Aspect > cloneAspect() const =0
Clone this Aspect into a new composite.
virtual void setAspectProperties(const Properties &someProperties)
Set the Properties of this Aspect. By default, this does nothing.
Definition: Aspect.cpp:56
virtual const State * getAspectState() const
Get the State of this Aspect.
Definition: Aspect.cpp:50
virtual void setAspectState(const State &otherState)
Set the State of this Aspect. By default, this does nothing.
Definition: Aspect.cpp:44
virtual const Properties * getAspectProperties() const
Get the Properties of this Aspect.
Definition: Aspect.cpp:62
virtual ~Aspect()=default
Virtual destructor.
virtual void setComposite(Composite *newComposite)
This function will be triggered (1) after the Aspect has been created [transfer will be false] and (2...
Definition: Aspect.cpp:68
virtual void loseComposite(Composite *oldComposite)
This function will be triggered if your Aspect is about to be removed from its Composite.
Definition: Aspect.cpp:74
Cloneable is a CRTP base class that provides an interface for easily creating data structures that ar...
Definition: Cloneable.hpp:54
Definition: Aspect.hpp:132
CompositeTrackingAspect()
Default constructor.
Definition: Aspect.hpp:46
void setComposite(Composite *newComposite) override
Grab the new Composite.
Definition: Aspect.hpp:77
CompositeType * getComposite()
Get the Composite of this Aspect.
Definition: Aspect.hpp:55
CompositeType * mComposite
Pointer to the current Composite of this Aspect.
Definition: Aspect.hpp:154
bool hasComposite() const
Returns true if this Aspect has a Composite that matches CompositeType.
Definition: Aspect.hpp:70
void loseComposite(Composite *oldComposite) override
Clear the old Composite.
Definition: Aspect.hpp:90
Composite is a base class that should be virtually inherited by any class that wants to be able to ma...
Definition: Composite.hpp:53
The MakeCloneable class is used to easily create an Cloneable (such as Node::State) which simply take...
Definition: Cloneable.hpp:84
Definition: BulletCollisionDetector.cpp:65