33#ifndef DART_COMMON_DETAIL_ASPECTWITHVERSION_HPP_
34#define DART_COMMON_DETAIL_ASPECTWITHVERSION_HPP_
52 void (*updateState)(DerivedT*) = &NoOp<DerivedT*> >
61 constexpr static void (*UpdateState)(
Derived*) = updateState;
72 template <
typename... BaseArgs>
74 :
Base(
std::forward<BaseArgs>(args)...), mState(state)
92 std::unique_ptr<
Aspect> cloneAspect() const override;
105 typename PropertiesDataT,
107 void (*updateProperties)(DerivedT*) = &
NoOp<DerivedT*> >
116 constexpr static void (*UpdateProperties)(
Derived*) = updateProperties;
132 template <
typename... BaseArgs>
157 std::
size_t incrementVersion();
161 void notifyPropertiesUpdate();
164 void notifyPropertiesUpdated();
183 void (*updateState)(DerivedT*)>
185 *
AspectWithState<BaseT, DerivedT, StateDataT, CompositeT, updateState>::
186 UpdateState)(DerivedT*);
194 void (*updateState)(DerivedT*)>
197 : BaseT(), mState(state)
208 void (*updateState)(DerivedT*)>
212 setState(
static_cast<const State&
>(otherState));
221 void (*updateState)(DerivedT*)>
224 getAspectState() const
235 void (*updateState)(DerivedT*)>
240 UpdateState(
static_cast<Derived*
>(
this));
249 void (*updateState)(DerivedT*)>
251 getState() const -> const
State&
262 void (*updateState)(DerivedT*)>
263std::unique_ptr<Aspect>
267 return std::make_unique<Derived>(mState);
280 typename PropertiesDataT,
282 void (*updateProperties)(DerivedT*)>
288 updateProperties>::UpdateProperties)(DerivedT*);
294 typename PropertiesDataT,
296 void (*updateProperties)(DerivedT*)>
313 typename PropertiesData,
315 void (*updateProperties)(DerivedT*)>
324 setProperties(
static_cast<const Properties&
>(someProperties));
331 typename PropertiesData,
333 void (*updateProperties)(DerivedT*)>
339 updateProperties>::getAspectProperties()
const
348 typename PropertiesData,
350 void (*updateProperties)(DerivedT*)>
359 this->notifyPropertiesUpdated();
366 typename PropertiesData,
368 void (*updateProperties)(DerivedT*)>
374 updateProperties>::getProperties()
const ->
const Properties&
383 typename PropertiesData,
385 void (*updateProperties)(DerivedT*)>
391 updateProperties>::cloneAspect()
const
393 return std::make_unique<Derived>(mProperties);
400 typename PropertiesData,
402 void (*updateProperties)(DerivedT*)>
408 updateProperties>::incrementVersion()
420 typename PropertiesData,
422 void (*updateProperties)(DerivedT*)>
428 updateProperties>::notifyPropertiesUpdate()
430 notifyPropertiesUpdated();
437 typename PropertiesData,
439 void (*updateProperties)(DerivedT*)>
445 updateProperties>::notifyPropertiesUpdated()
447 UpdateProperties(
static_cast<Derived*
>(
this));
448 this->incrementVersion();
#define DART_DEPRECATED(version)
Definition Deprecated.hpp:51
BodyPropPtr properties
Definition SdfParser.cpp:80
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
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
AspectWithProtectedState generates implementations of the State managing functions for an Aspect clas...
Definition AspectWithVersion.hpp:54
CompositeT CompositeType
Definition AspectWithVersion.hpp:59
void setAspectState(const Aspect::State &otherState) override final
Definition AspectWithVersion.hpp:210
AspectWithState(const StateData &state, BaseArgs &&... args)
Construct this Aspect and pass args into the constructor of the Base class.
Definition AspectWithVersion.hpp:73
AspectWithState(const AspectWithState &)=delete
DerivedT Derived
Definition AspectWithVersion.hpp:57
BaseT Base
Definition AspectWithVersion.hpp:56
StateDataT StateData
Definition AspectWithVersion.hpp:58
const Aspect::State * getAspectState() const override final
Definition AspectWithVersion.hpp:224
AspectWithState(const StateData &state=StateData())
Construct using a StateData instance.
AspectWithProtectedProperties generates implementations of the Property managing functions for an Asp...
Definition AspectWithVersion.hpp:109
std::size_t incrementVersion()
Increment the version of this Aspect and its Composite.
Definition AspectWithVersion.hpp:408
PropertiesDataT PropertiesData
Definition AspectWithVersion.hpp:113
AspectWithVersionedProperties(const PropertiesData &properties, BaseArgs &&... args)
Construct this Aspect and pass args into the constructor of the Base class.
Definition AspectWithVersion.hpp:133
const Aspect::Properties * getAspectProperties() const override final
Definition AspectWithVersion.hpp:339
CompositeT CompositeType
Definition AspectWithVersion.hpp:114
void setAspectProperties(const Aspect::Properties &someProperties) override final
Definition AspectWithVersion.hpp:321
AspectWithVersionedProperties(const AspectWithVersionedProperties &)=delete
AspectWithVersionedProperties(const PropertiesData &properties=PropertiesData())
Construct using a PropertiesData instance.
Definition AspectWithVersion.hpp:302
DerivedT Derived
Definition AspectWithVersion.hpp:112
BaseT Base
Definition AspectWithVersion.hpp:111
void NoOp(Args...)
NoOp is short for "no operation".
Definition NoOp.hpp:44
Definition BulletCollisionDetector.cpp:65
Definition SharedLibraryManager.hpp:46