//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Base/Type/Cloneable.h
//! @brief     Defines and implements the standard mix-in Cloneable.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifndef BORNAGAIN_BASE_TYPE_ICLONEABLE_H
#define BORNAGAIN_BASE_TYPE_ICLONEABLE_H

//! Interface for polymorphic classes that should not be copied, except by explicit cloning.
//!
//! Child classes of Cloneable must provide clone().

class Cloneable {
protected:
#ifndef SWIG
    Cloneable() = default;
    virtual ~Cloneable() = default;

    Cloneable(const Cloneable&) = delete;
    Cloneable(Cloneable&&) = default;

    virtual Cloneable* clone() const = 0;
#endif // SWIG
};

#endif // BORNAGAIN_BASE_TYPE_ICLONEABLE_H
