Skip to content
Snippets Groups Projects
ICloneable.h 1.44 KiB
Newer Older
  • Learn to ignore specific revisions
  • // ************************************************************************** //
    
    //  BornAgain: simulate and fit scattering at grazing incidence
    //
    
    //! @file      Tools/inc/ICloneable.h
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
    //! @brief     Defines the standard mix-in ICloneable.
    
    //! @homepage  http://apps.jcns.fz-juelich.de/BornAgain
    
    //! @license   GNU General Public License v3 or higher (see COPYING)
    
    //! @copyright Forschungszentrum Jülich GmbH 2013
    //! @authors   Scientific Computing Group at MLZ Garching
    
    //! @authors   C. Durniak, G. Pospelov, W. Van Herck, J. Wuttke
    
    //
    // ************************************************************************** //
    
    
    #ifndef ICLONEABLE_H
    #define ICLONEABLE_H
    
    #include "Exceptions.h"
    
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
    
    
    //! @class ICloneable
    
    //! @ingroup tools_internal
    //! @brief Interface for objects that must not be copied, except by cloning.
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
    //! This virtual base class disables the copy constructor and the operator=
    //! in all its child classes.
    //! Child classes should provide clone().
    
        ICloneable(){}
        virtual ~ICloneable() {}
        virtual ICloneable *clone() const = 0;
    
    
    Van Herck, Walter's avatar
    Van Herck, Walter committed
        ICloneable(const ICloneable& ) {
            throw NotImplementedException(
            "ICloneable(const ICloneable& ) -> Error: not implemented.");
        }
        ICloneable& operator=(const ICloneable& ) {
            throw NotImplementedException(
            "ICloneable& operator=(const ICloneable& ) -> Error: not implemented.");
        }