DART
6.10.1
|
The MakeCloneable class is used to easily create an Cloneable (such as Node::State) which simply takes an existing class (Mixin) and creates an Cloneable that wraps it. More...
#include <Cloneable.hpp>
Public Types | |
using | Data = Mixin |
Public Member Functions | |
MakeCloneable () | |
Default constructor. Uses the default constructor of Mixin. More... | |
template<typename... Args> | |
MakeCloneable (Args &&... args) | |
Templated constructor. More... | |
MakeCloneable (const Mixin &mixin) | |
Constructs using a Mixin instance. More... | |
MakeCloneable (Mixin &&mixin) | |
Constructs using a Mixin rvalue. More... | |
MakeCloneable (const MakeCloneable< Base, Mixin > &other) | |
Copy constructor. More... | |
MakeCloneable (MakeCloneable< Base, Mixin > &&other) | |
Move constructor. More... | |
MakeCloneable & | operator= (const Mixin &mixin) |
Copy assignment operator that uses a Mixin instance. More... | |
MakeCloneable & | operator= (Mixin &&mixin) |
Move assignment operator that uses a Mixin rvalue. More... | |
MakeCloneable & | operator= (const MakeCloneable &other) |
Copy assignment operator. More... | |
MakeCloneable & | operator= (MakeCloneable &&other) |
Move assignment operator. More... | |
std::unique_ptr< Base > | clone () const override final |
void | copy (const Base &other) override final |
Static Public Member Functions | |
template<typename... Args> | |
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::shared_ptr< MakeCloneable > | createShared (Args &&... args) |
The MakeCloneable class is used to easily create an Cloneable (such as Node::State) which simply takes an existing class (Mixin) and creates an Cloneable that wraps it.
This creates all the appropriate copy, move, and clone members, allowing you to follow the Rule Of Zero. You can also construct an instance in the exact same way that you would construct a Mixin instance.
using dart::common::MakeCloneable< Base, Mixin >::Data = Mixin |
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable |
Default constructor. Uses the default constructor of Mixin.
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable | ( | Args &&... | args | ) |
Templated constructor.
Uses whichever Mixin constructor is able to match the arguments.
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable | ( | const Mixin & | mixin | ) |
Constructs using a Mixin instance.
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable | ( | Mixin && | mixin | ) |
Constructs using a Mixin rvalue.
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable | ( | const MakeCloneable< Base, Mixin > & | other | ) |
Copy constructor.
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable | ( | MakeCloneable< Base, Mixin > && | other | ) |
Move constructor.
|
finaloverride |
|
finaloverride |
|
inlinestatic |
Create shared instance of this class
MakeCloneable< Base, Mixin > & dart::common::MakeCloneable< Base, Mixin >::operator= | ( | const MakeCloneable< Base, Mixin > & | other | ) |
Copy assignment operator.
MakeCloneable< Base, Mixin > & dart::common::MakeCloneable< Base, Mixin >::operator= | ( | const Mixin & | mixin | ) |
Copy assignment operator that uses a Mixin instance.
MakeCloneable< Base, Mixin > & dart::common::MakeCloneable< Base, Mixin >::operator= | ( | MakeCloneable< Base, Mixin > && | other | ) |
Move assignment operator.
MakeCloneable< Base, Mixin > & dart::common::MakeCloneable< Base, Mixin >::operator= | ( | Mixin && | mixin | ) |
Move assignment operator that uses a Mixin rvalue.