From 33bb3ac6296e48be173c02fd8e7f0e4fa996d9d7 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Fri, 16 Feb 2024 15:21:18 +0100 Subject: [PATCH] start class VectorWC --- Base/Types/VectorWC.h | 29 +++++++++++++++++++++++++++++ GUI/Model/Sample/SamplesSet.h | 4 ++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 Base/Types/VectorWC.h diff --git a/Base/Types/VectorWC.h b/Base/Types/VectorWC.h new file mode 100644 index 00000000000..3da7f43d121 --- /dev/null +++ b/Base/Types/VectorWC.h @@ -0,0 +1,29 @@ +// ************************************************************************************************ +// +// BornAgain: simulate and fit reflection and scattering +// +//! @file Base/Types/VectorWC.h +//! @brief Defines and implements templated class VectorWC. +//! +//! @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) +// +// ************************************************************************************************ + +#ifdef SWIG +#error no need to expose this header to Swig +#endif // SWIG +#ifndef BORNAGAIN_BASE_TYPES_VECTORWC_H +#define BORNAGAIN_BASE_TYPES_VECTORWC_H + +#include "Base/Types/OwningVector.h" + +//! An OwningVector with a current index. + +template <class T> class VectorWC : public OwningVector<T> { +public: +}; + +#endif // BORNAGAIN_BASE_TYPES_VECTORWC_H diff --git a/GUI/Model/Sample/SamplesSet.h b/GUI/Model/Sample/SamplesSet.h index 95896eee639..b860dbd1fc1 100644 --- a/GUI/Model/Sample/SamplesSet.h +++ b/GUI/Model/Sample/SamplesSet.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_GUI_MODEL_SAMPLE_SAMPLESSET_H #define BORNAGAIN_GUI_MODEL_SAMPLE_SAMPLESSET_H -#include "Base/Types/OwningVector.h" +#include "Base/Types/VectorWC.h" #include <QXmlStreamReader> class SampleItem; @@ -41,7 +41,7 @@ public: void setCurrentIndex(int newIndex) { m_current_index = newIndex; } private: - OwningVector<SampleItem> m_samples; + VectorWC<SampleItem> m_samples; int m_current_index = 0; }; -- GitLab