33 #ifndef DART_COMMON_EMBEDDEDASPECT_HPP_ 34 #define DART_COMMON_EMBEDDEDASPECT_HPP_ 36 #include "dart/common/CompositeJoiner.hpp" 37 #include "dart/common/RequiresAspect.hpp" 38 #include "dart/common/detail/EmbeddedAspect.hpp" 50 template <
class CompositeT,
typename StateDataT>
52 CompositeTrackingAspect<CompositeT>,
53 EmbeddedStateAspect<CompositeT, StateDataT>,
60 using State =
typename Impl::State;
61 using StateData =
typename Impl::StateData;
63 template <
typename... Args>
69 virtual ~EmbeddedStateAspect() =
default;
88 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
90 template <
class DerivedT,
typename StateDataT>
92 common::EmbeddedStateAspect<DerivedT, StateDataT> >
95 using Derived = DerivedT;
97 using AspectState =
typename Aspect::State;
98 using AspectStateData =
typename Aspect::StateData;
102 template <
typename... Args>
108 virtual ~EmbedState() =
default;
110 const AspectState& getAspectState()
const 119 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
125 template <
class DerivedT,
typename StateDataT,
typename... BaseComposites>
127 :
public CompositeJoiner<EmbedState<DerivedT, StateDataT>, BaseComposites...>
131 using Derived =
typename Impl::Derived;
132 using AspectStateData =
typename Impl::AspectStateData;
133 using AspectState =
typename Impl::AspectState;
136 using Impl::getAspectState;
139 template <
typename... Args>
145 virtual ~EmbedStateOnTopOf() =
default;
148 using Impl::mAspectState;
158 template <
class CompositeT,
typename PropertiesDataT>
161 CompositeTrackingAspect<CompositeT>,
162 EmbeddedPropertiesAspect<CompositeT, PropertiesDataT>,
169 using Properties =
typename Impl::Properties;
170 using PropertiesData =
typename Impl::PropertiesData;
173 template <
typename... Args>
179 virtual ~EmbeddedPropertiesAspect() =
default;
199 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
200 template <
class DerivedT,
typename PropertiesDataT>
203 common::EmbeddedPropertiesAspect<DerivedT, PropertiesDataT> >
206 using Derived = DerivedT;
208 using AspectProperties =
typename Aspect::Properties;
209 using AspectPropertiesData =
typename Aspect::PropertiesData;
213 template <
typename... Args>
219 virtual ~EmbedProperties() =
default;
223 return mAspectProperties;
230 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
236 template <
class DerivedT,
typename PropertiesDataT,
typename... CompositeBases>
238 EmbedProperties<DerivedT, PropertiesDataT>,
243 using Derived =
typename Impl::Derived;
244 using AspectPropertiesData =
typename Impl::AspectPropertiesData;
245 using AspectProperties =
typename Impl::AspectProperties;
248 using Impl::getAspectProperties;
251 template <
typename... Args>
253 :
Base(NoArg, std::forward<Args>(args)...)
258 virtual ~EmbedPropertiesOnTopOf() =
default;
261 using Impl::mAspectProperties;
274 template <
class CompositeT,
typename StateDataT,
typename PropertiesDataT>
277 detail::EmbeddedStateAspect<
278 CompositeTrackingAspect<CompositeT>,
279 EmbeddedStateAndPropertiesAspect<
284 EmbeddedStateAndPropertiesAspect<
302 EmbeddedPropertiesAspect<AspectStateImpl, Derived, PropertiesDataT>;
306 using State =
typename AspectStateImpl::State;
307 using StateData =
typename AspectStateImpl::StateData;
309 using Properties =
typename AspectPropertiesImpl::Properties;
310 using PropertiesData =
typename AspectPropertiesImpl::PropertiesData;
312 using CompositeType = CompositeT;
341 const StateData& state,
const PropertiesData& properties)
349 const PropertiesData& properties,
const StateData& state)
358 return std::make_unique<Derived>(this->
getState(), this->getProperties());
374 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
375 template <
class DerivedT,
typename StateDataT,
typename PropertiesDataT>
377 common::EmbeddedStateAndPropertiesAspect<
383 using Derived = DerivedT;
385 EmbeddedStateAndPropertiesAspect<DerivedT, StateDataT, PropertiesDataT>;
387 using AspectState =
typename Aspect::State;
388 using AspectStateData =
typename Aspect::StateData;
390 using AspectProperties =
typename Aspect::Properties;
391 using AspectPropertiesData =
typename Aspect::PropertiesData;
395 template <
typename... Args>
401 virtual ~EmbedStateAndProperties() =
default;
403 const AspectState& getAspectState()
const 410 return mAspectProperties;
420 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
429 typename PropertiesDataT,
430 typename... CompositeBases>
433 EmbedStateAndProperties<DerivedT, StateDataT, PropertiesDataT>,
438 using Derived =
typename Impl::Derived;
439 using AspectStateData =
typename Impl::AspectStateData;
440 using AspectState =
typename Impl::AspectState;
441 using AspectPropertiesData =
typename Impl::AspectPropertiesData;
442 using AspectProperties =
typename Impl::AspectProperties;
444 using Impl::getAspectProperties;
445 using Impl::getAspectState;
449 template <
typename... Args>
451 :
Base(NoArg, std::forward<Args>(args)...)
456 virtual ~EmbedStateAndPropertiesOnTopOf() =
default;
459 using Impl::mAspectProperties;
460 using Impl::mAspectState;
466 #endif // DART_COMMON_EMBEDDEDASPECT_HPP_ Inherit this class to embed a State into your Composite object.
Definition: EmbeddedAspect.hpp:91
RequiresAspect allows classes that inherit Composite to know which Aspects are required for their ope...
Definition: RequiresAspect.hpp:49
Inherit this class to embed both State and Properties into your Composite object. ...
Definition: EmbeddedAspect.hpp:376
This is an alternative to EmbedStateAndProperties which allows your class to also inherit other Compo...
Definition: EmbeddedAspect.hpp:431
EmbeddedStateAndPropertiesAspect(const StateData &state)
Construct using a State. The object's Properties will remain unaffected.
Definition: EmbeddedAspect.hpp:326
const State & getState() const
Get the State of this Aspect.
Definition: EmbeddedAspect.hpp:169
Definition: Aspect.cpp:40
Definition: EmbeddedAspect.hpp:252
Terminator for the variadic template.
Definition: CompositeJoiner.hpp:44
AspectState mAspectState
Aspect::State data, directly accessible to your derived class.
Definition: EmbeddedAspect.hpp:117
virtual const Properties * getAspectProperties() const
Get the Properties of this Aspect.
Definition: Aspect.cpp:62
This is the implementation of a standard embedded-properties Aspect.
Definition: EmbeddedAspect.hpp:159
class State
Definition: State.hpp:65
std::unique_ptr< Aspect > cloneAspect() const override
Clone this Aspect into a new composite.
Definition: EmbeddedAspect.hpp:356
This is an alternative to EmbedState which allows your class to also inherit other Composite objects ...
Definition: EmbeddedAspect.hpp:126
This is the implementation of a standard embedded-state Aspect.
Definition: EmbeddedAspect.hpp:51
This is the implementation of a standard combination of embedded-state and embedded-properties Aspect...
Definition: EmbeddedAspect.hpp:275
AspectProperties mAspectProperties
Aspect::Properties data, directly accessible to your derived class.
Definition: EmbeddedAspect.hpp:418
Inherit this class to embed Properties into your Composite object.
Definition: EmbeddedAspect.hpp:201
AspectState mAspectState
Aspect::State data, directly accessible to your derived class.
Definition: EmbeddedAspect.hpp:415
EmbeddedStateAndPropertiesAspect(const StateData &state, const PropertiesData &properties)
Construct using a State and Properties instance.
Definition: EmbeddedAspect.hpp:340
AspectProperties mAspectProperties
Aspect::Properties data, directly accessible to your derived class.
Definition: EmbeddedAspect.hpp:228
EmbeddedStateAspect()
Construct this Aspect without affecting the State.
Definition: EmbeddedAspect.hpp:112
Definition: EmbeddedAspect.hpp:82
EmbeddedStateAndPropertiesAspect(const PropertiesData &properties, const StateData &state)
Construct using a Properties and State instance.
Definition: EmbeddedAspect.hpp:348
This is an alternative to EmbedProperties which allows your class to also inherit other Composite obj...
Definition: EmbeddedAspect.hpp:237
EmbeddedStateAndPropertiesAspect(const PropertiesData &properties)
Construct using Properties. The object's State will remain unaffected.
Definition: EmbeddedAspect.hpp:333
EmbeddedStateAndPropertiesAspect()
Construct using nothing. The object will remain unaffected.
Definition: EmbeddedAspect.hpp:320