33 #ifndef DART_COMMON_CLONEABLE_HPP_
34 #define DART_COMMON_CLONEABLE_HPP_
69 virtual std::unique_ptr<T>
clone()
const = 0;
72 virtual void copy(
const T& anotherCloneable) = 0;
82 template <
class Base,
class Mixin>
89 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
98 template <
typename... Args>
126 std::unique_ptr<Base>
clone() const override final;
129 void copy(const Base& other) override final;
137 void (*setData)(OwnerT*, const DataT&),
138 DataT (*getData)(const OwnerT*)>
153 template <
typename... Args>
158 template <
typename... Args>
180 void set(
const Data& data);
183 void set(
Data&& data);
198 const OwnerT* getOwner()
const;
201 std::unique_ptr<Base>
clone() const override final;
204 void copy(const Base& other) override final;
219 template <typename MapType>
260 void copy(
const MapType& otherMap,
bool merge =
false);
270 void merge(
const MapType& otherMap);
276 const MapType& getMap()
const;
286 template <
typename T>
306 std::unique_ptr<CloneableVector<T> >
clone()
const;
312 std::vector<T>& getVector();
315 const std::vector<T>& getVector()
const;
#define DART_DEFINE_ALIGNED_SHARED_OBJECT_CREATOR(class_name)
Definition: Memory.hpp:155
MapHolder is a templated wrapper class that is used to allow maps of Aspect::State and Aspect::Proper...
Definition: Cloneable.hpp:221
MapType mMap
A map containing the collection of States for the Aspect.
Definition: Cloneable.hpp:280
CloneableMap()=default
Default constructor.
The CloneableVector type wraps a std::vector of an Cloneable type allowing it to be handled by an Clo...
Definition: Cloneable.hpp:288
std::vector< T > mVector
The std::vector that this class is wrapping.
Definition: Cloneable.hpp:319
CloneableVector()=default
Default constructor.
Cloneable is a CRTP base class that provides an interface for easily creating data structures that ar...
Definition: Cloneable.hpp:54
virtual std::unique_ptr< T > clone() const =0
Implement this function to allow your Cloneable type to be copied safely.
Cloneable()=default
Default constructor.
Cloneable & operator=(const Cloneable &doNotCopy)=delete
Do not copy this class directly, use clone() or copy() instead.
Cloneable(const Cloneable &doNotCopy)=delete
Do not copy this class directly, use clone() or copy() instead.
virtual ~Cloneable()=default
Virtual destructor.
virtual void copy(const T &anotherCloneable)=0
Copy the contents of anotherCloneable into this one.
The MakeCloneable class is used to easily create an Cloneable (such as Node::State) which simply take...
Definition: Cloneable.hpp:84
void copy(const Base &other) override final
Definition: Cloneable.hpp:133
Mixin Data
Definition: Cloneable.hpp:86
std::unique_ptr< Base > clone() const override final
Definition: Cloneable.hpp:126
MakeCloneable()
Default constructor. Uses the default constructor of Mixin.
Definition: Cloneable.hpp:44
MakeCloneable & operator=(const Mixin &mixin)
Copy assignment operator that uses a Mixin instance.
Definition: Cloneable.hpp:92
Definition: Cloneable.hpp:140
OwnerT Owner
Definition: Cloneable.hpp:143
DataT Data
Definition: Cloneable.hpp:142
Definition: BulletCollisionDetector.cpp:65
Definition: SharedLibraryManager.hpp:46