//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Sample/Multilayer/ILayer.h
//! @brief     Defines class ILayer.
//!
//! @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_SAMPLE_MULTILAYER_ILAYER_H
#define BORNAGAIN_SAMPLE_MULTILAYER_ILAYER_H

#include "Base/Type/Cloneable.h"
#include <memory>
#include <vector>

class Layer;

//! Common base for layers and stacks.

class ILayer : public Cloneable {
public:
#ifndef SWIG
    ILayer* clone() const override = 0;

    //! Returns cloned layers in a flat structure
    virtual std::vector<std::unique_ptr<Layer>> flatClones() const = 0;

    virtual void validate() const {}

protected:
    mutable bool m_validated{false};
#endif // SWIG
};

#endif // BORNAGAIN_SAMPLE_MULTILAYER_ILAYER_H
