33 #ifndef DART_COMMON_DETAIL_PROXYASPECT_HPP_ 34 #define DART_COMMON_DETAIL_PROXYASPECT_HPP_ 36 #include "dart/common/Aspect.hpp" 43 template <
class BaseT,
class CompositeT,
typename StateT>
48 using CompositeType = CompositeT;
54 template <
typename... Args>
62 void setAspectState(
const Aspect::State& state)
override final 74 std::unique_ptr<Aspect> cloneAspect()
const override 76 return std::make_unique<ProxyStateAspect>();
83 Base::setComposite(newComposite);
86 typename State::Owner* owner
87 =
dynamic_cast<typename State::Owner*
>(newComposite);
100 Base::loseComposite(oldComposite);
108 template <
class BaseT,
class CompositeT,
typename PropertiesT>
113 using CompositeType = CompositeT;
114 using Properties = PropertiesT;
119 template <
typename... Args>
121 : Base(
std::forward<Args>(args)...), mProxyProperties()
129 mProxyProperties.set(static_cast<const Properties&>(properties));
135 return &mProxyProperties;
139 std::unique_ptr<Aspect> cloneAspect()
const override 141 return std::make_unique<ProxyPropertiesAspect>();
148 Base::setComposite(newComposite);
149 typename Properties::Owner* owner
150 =
dynamic_cast<typename Properties::Owner*
>(newComposite);
152 if (owner && mProxyProperties.getOwner() != owner)
155 mProxyProperties = Properties(owner, mProxyProperties.get());
162 mProxyProperties = Properties(mProxyProperties.get());
163 Base::loseComposite(oldComposite);
174 #endif // DART_COMMON_DETAIL_PROXYASPECT_HPP_ State mProxyState
Proxy state for this Aspect.
Definition: ProxyAspect.hpp:104
Definition: ProxyAspect.hpp:109
Definition: SharedLibraryManager.hpp:46
If your Aspect has Properties, then that Properties class should inherit this Aspect::Properties clas...
Definition: Aspect.hpp:85
ProxyStateAspect(Args &&... args)
General constructor.
Definition: ProxyAspect.hpp:55
Definition: Aspect.cpp:40
If your Aspect has a State, then that State class should inherit this Aspect::State class...
Definition: Aspect.hpp:64
void loseComposite(Composite *oldComposite) override
Reconfigure the Aspect to unlink it from this Aspect's old Composite.
Definition: ProxyAspect.hpp:97
class State
Definition: State.hpp:65
Properties mProxyProperties
Proxy properties for this Aspect.
Definition: ProxyAspect.hpp:167
ProxyPropertiesAspect(Args &&... args)
General constructor.
Definition: ProxyAspect.hpp:120
void loseComposite(Composite *oldComposite) override
Reconfigure the Aspect to unlink it from this Aspect's old Composite.
Definition: ProxyAspect.hpp:160
void setComposite(Composite *newComposite) override
Reconfigure the Aspect to link it to this Aspect's new Composite.
Definition: ProxyAspect.hpp:81
Definition: ProxyAspect.hpp:44
Composite is a base class that should be virtually inherited by any class that wants to be able to ma...
Definition: Composite.hpp:52
void setComposite(Composite *newComposite) override
Reconfigure the Aspect to link it to this Aspect's new Composite.
Definition: ProxyAspect.hpp:146