dart
Public Types | Public Member Functions | List of all members
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 >:
Inheritance graph
[legend]
Collaboration diagram for dart::common::MakeCloneable< Base, Mixin >:
Collaboration graph
[legend]

Public Types

using Data = Mixin
 

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW MakeCloneable ()
 Default constructor. Uses the default constructor of Mixin.
 
template<typename... Args>
 MakeCloneable (Args &&... args)
 Templated constructor. More...
 
 MakeCloneable (const Mixin &mixin)
 Constructs using a Mixin instance.
 
 MakeCloneable (Mixin &&mixin)
 Constructs using a Mixin rvalue.
 
 MakeCloneable (const MakeCloneable< Base, Mixin > &other)
 Copy constructor.
 
 MakeCloneable (MakeCloneable< Base, Mixin > &&other)
 Move constructor.
 
MakeCloneableoperator= (const Mixin &mixin)
 Copy assignment operator that uses a Mixin instance.
 
MakeCloneableoperator= (Mixin &&mixin)
 Move assignment operator that uses a Mixin rvalue.
 
MakeCloneableoperator= (const MakeCloneable &other)
 Copy assignment operator.
 
MakeCloneableoperator= (MakeCloneable &&other)
 Move assignment operator.
 
std::unique_ptr< Base > clone () const override final
 
void copy (const Base &other) override final
 

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.

Constructor & Destructor Documentation

◆ MakeCloneable()

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.


The documentation for this class was generated from the following file: