DART
6.10.1
|
Cloneable is a CRTP base class that provides an interface for easily creating data structures that are meant to be extended. More...
#include <Cloneable.hpp>
Public Member Functions | |
Cloneable ()=default | |
Default constructor. More... | |
virtual | ~Cloneable ()=default |
Virtual destructor. More... | |
Cloneable (const Cloneable &doNotCopy)=delete | |
Do not copy this class directly, use clone() or copy() instead. More... | |
Cloneable & | operator= (const Cloneable &doNotCopy)=delete |
Do not copy this class directly, use clone() or copy() instead. More... | |
virtual std::unique_ptr< T > | clone () const =0 |
Implement this function to allow your Cloneable type to be copied safely. More... | |
virtual void | copy (const T &anotherCloneable)=0 |
Copy the contents of anotherCloneable into this one. More... | |
Cloneable is a CRTP base class that provides an interface for easily creating data structures that are meant to be extended.
Ordinary copying does not work with extended data structures, because information from the derived classes will typically be lost during a copy. The Cloneable class provides an interface for creating a new copy of an extended data structure, as well as copying information between two extended data structures of the same type.
|
default |
Default constructor.
|
virtualdefault |
Virtual destructor.
|
delete |
|
pure virtual |
Implement this function to allow your Cloneable type to be copied safely.
|
pure virtual |
Copy the contents of anotherCloneable into this one.
|
delete |