Newer
Older
// ************************************************************************** //

Wuttke, Joachim
committed
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Tools/inc/ICloneable.h

Wuttke, Joachim
committed
//!
//! @homepage http://apps.jcns.fz-juelich.de/BornAgain

Wuttke, Joachim
committed
//! @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"
//! @ingroup tools_internal
//! @brief Interface for objects that must not be copied, except by cloning.
//! This virtual base class disables the copy constructor and the operator=
//! in all its child classes.
//! Child classes should provide clone().
class BA_CORE_API_ ICloneable
Van Herck, Walter
committed
public:
ICloneable(){}
virtual ~ICloneable() {}
virtual ICloneable *clone() const = 0;
Van Herck, Walter
committed
private:
ICloneable(const ICloneable& ) {
throw NotImplementedException(
"ICloneable(const ICloneable& ) -> Error: not implemented.");
}
ICloneable& operator=(const ICloneable& ) {
throw NotImplementedException(
"ICloneable& operator=(const ICloneable& ) -> Error: not implemented.");
}
};
#endif // ICLONEABLE_H