33#ifndef DART_COMMON_CLONEABLE_HPP_
34#define DART_COMMON_CLONEABLE_HPP_
70 virtual std::unique_ptr<T>
clone()
const = 0;
73 virtual void copy(
const T& anotherCloneable) = 0;
83template <
class Base,
class Mixin>
91 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
100 template <
typename... Args>
128 std::unique_ptr<Base>
clone() const override final;
131 void copy(const Base& other) override final;
136template <class Base, class OwnerT, class DataT,
137 void (*setData)(OwnerT*, const DataT&),
138 DataT (*getData)(const OwnerT*)>
154 template <
typename... Args>
159 template <
typename... Args>
181 void set(
const Data& data);
184 void set(
Data&& data);
199 const OwnerT* getOwner()
const;
202 std::unique_ptr<Base>
clone() const override final;
205 void copy(const Base& other) override final;
222template <typename MapType>
264 void copy(
const MapType& otherMap,
bool merge=
false);
274 void merge(
const MapType& otherMap);
280 const MapType& getMap()
const;
312 std::unique_ptr< CloneableVector<T> > clone()
const;
318 std::vector<T>& getVector();
321 const std::vector<T>& getVector()
const;
#define DART_DEFINE_ALIGNED_SHARED_OBJECT_CREATOR(class_name)
Definition Memory.hpp:148
MapHolder is a templated wrapper class that is used to allow maps of Aspect::State and Aspect::Proper...
Definition Cloneable.hpp:224
MapType mMap
A map containing the collection of States for the Aspect.
Definition Cloneable.hpp:285
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:293
std::vector< T > mVector
The std::vector that this class is wrapping.
Definition Cloneable.hpp:326
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
Cloneable()=default
Default constructor.
Cloneable(const Cloneable &doNotCopy)=delete
Do not copy this class directly, use clone() or copy() instead.
virtual ~Cloneable()=default
Virtual destructor.
virtual std::unique_ptr< T > clone() const =0
Implement this function to allow your Cloneable type to be copied safely.
Cloneable & operator=(const Cloneable &doNotCopy)=delete
Do not copy this class directly, use clone() or copy() instead.
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:85
void copy(const Base &other) override final
Definition Cloneable.hpp:134
Mixin Data
Definition Cloneable.hpp:88
std::unique_ptr< Base > clone() const override final
Definition Cloneable.hpp:127
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:93
Definition Cloneable.hpp:140
OwnerT Owner
Definition Cloneable.hpp:144
DataT Data
Definition Cloneable.hpp:143
Definition BulletCollisionDetector.cpp:63
Definition SharedLibraryManager.hpp:43