DART  6.10.1
dart::common::MakeCloneable< Base, Mixin > Class Template Reference

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>

Inheritance diagram for dart::common::MakeCloneable< Base, Mixin >:

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...
 
MakeCloneableoperator= (const Mixin &mixin)
 Copy assignment operator that uses a Mixin instance. More...
 
MakeCloneableoperator= (Mixin &&mixin)
 Move assignment operator that uses a Mixin rvalue. More...
 
MakeCloneableoperator= (const MakeCloneable &other)
 Copy assignment operator. More...
 
MakeCloneableoperator= (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< MakeCloneablecreateShared (Args &&... args)
 

Detailed Description

template<class Base, class Mixin>
class dart::common::MakeCloneable< Base, Mixin >

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.

Member Typedef Documentation

◆ Data

template<class Base , class Mixin >
using dart::common::MakeCloneable< Base, Mixin >::Data = Mixin

Constructor & Destructor Documentation

◆ MakeCloneable() [1/6]

template<class Base , class Mixin >
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable

Default constructor. Uses the default constructor of Mixin.

◆ MakeCloneable() [2/6]

template<class Base , class Mixin >
template<typename... Args>
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable ( Args &&...  args)

Templated constructor.

Uses whichever Mixin constructor is able to match the arguments.

◆ MakeCloneable() [3/6]

template<class Base , class Mixin >
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable ( const Mixin &  mixin)

Constructs using a Mixin instance.

◆ MakeCloneable() [4/6]

template<class Base , class Mixin >
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable ( Mixin &&  mixin)

Constructs using a Mixin rvalue.

◆ MakeCloneable() [5/6]

template<class Base , class Mixin >
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable ( const MakeCloneable< Base, Mixin > &  other)

Copy constructor.

◆ MakeCloneable() [6/6]

template<class Base , class Mixin >
dart::common::MakeCloneable< Base, Mixin >::MakeCloneable ( MakeCloneable< Base, Mixin > &&  other)

Move constructor.

Member Function Documentation

◆ clone()

template<class Base , class Mixin >
std::unique_ptr< Base > dart::common::MakeCloneable< Base, Mixin >::clone
finaloverride

◆ copy()

template<class Base , class Mixin >
void dart::common::MakeCloneable< Base, Mixin >::copy ( const Base &  other)
finaloverride

◆ createShared()

template<class Base , class Mixin >
template<typename... Args>
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::shared_ptr< MakeCloneable > dart::common::MakeCloneable< Base, Mixin >::createShared ( Args &&...  args)
inlinestatic

Create shared instance of this class

◆ operator=() [1/4]

template<class Base , class Mixin >
MakeCloneable< Base, Mixin > & dart::common::MakeCloneable< Base, Mixin >::operator= ( const MakeCloneable< Base, Mixin > &  other)

Copy assignment operator.

◆ operator=() [2/4]

template<class Base , class Mixin >
MakeCloneable< Base, Mixin > & dart::common::MakeCloneable< Base, Mixin >::operator= ( const Mixin &  mixin)

Copy assignment operator that uses a Mixin instance.

◆ operator=() [3/4]

template<class Base , class Mixin >
MakeCloneable< Base, Mixin > & dart::common::MakeCloneable< Base, Mixin >::operator= ( MakeCloneable< Base, Mixin > &&  other)

Move assignment operator.

◆ operator=() [4/4]

template<class Base , class Mixin >
MakeCloneable< Base, Mixin > & dart::common::MakeCloneable< Base, Mixin >::operator= ( Mixin &&  mixin)

Move assignment operator that uses a Mixin rvalue.