BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ICloneable.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Base/Types/ICloneable.h
6 //! @brief Defines and implements the standard mix-in ICloneable.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #ifndef BORNAGAIN_BASE_TYPES_ICLONEABLE_H
16 #define BORNAGAIN_BASE_TYPES_ICLONEABLE_H
17 
18 //! Interface for polymorphic classes that should not be copied, except by explicit cloning.
19 //!
20 //! Child classes of ICloneable must provide clone().
21 
22 //! @ingroup tools_internal
23 
25 {
26 public:
27  ICloneable() = default;
28  virtual ~ICloneable() = default;
29 
30  ICloneable(const ICloneable&) = delete;
31  ICloneable(ICloneable&&) = default;
32 
33  virtual ICloneable* clone() const = 0;
34  virtual void transferToCPP() {} //!< Used for Python overriding of clone (see swig/tweaks.py)
35 };
36 
37 #endif // BORNAGAIN_BASE_TYPES_ICLONEABLE_H
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Definition: ICloneable.h:25
virtual void transferToCPP()
Used for Python overriding of clone (see swig/tweaks.py)
Definition: ICloneable.h:34
ICloneable(const ICloneable &)=delete
virtual ICloneable * clone() const =0
ICloneable(ICloneable &&)=default
ICloneable()=default
virtual ~ICloneable()=default