diff --git a/Base/Axis/Frame.cpp b/Base/Axis/Frame.cpp index 1178ba25bddd274c8531365f387e9907acec2b92..5e25bbb8b021fb456096adb7447b6d1ea0e3f15e 100644 --- a/Base/Axis/Frame.cpp +++ b/Base/Axis/Frame.cpp @@ -18,8 +18,8 @@ #include "Base/Util/Assert.h" #include "Base/Util/StringUtil.h" -Frame::Frame(CloneableVector<const Scale> axes) - : m_axes(std::move(axes)) +Frame::Frame(const CloneableVector<const Scale>& axes) + : m_axes(axes) , m_size(FrameUtil::product_size(m_axes.reference())) { } diff --git a/Base/Axis/Frame.h b/Base/Axis/Frame.h index ebc420dbfd40304ba5acfbe27a9b6e15b0ac1fbf..7b8b0b817f4a6ae66ecf26f4863a92c0626432ab 100644 --- a/Base/Axis/Frame.h +++ b/Base/Axis/Frame.h @@ -27,7 +27,7 @@ class Scale; class Frame { public: //! Constructor that takes ownership of supplied axes. - Frame(CloneableVector<const Scale> axes); + Frame(const CloneableVector<const Scale>& axes); Frame(const Scale* ax0); Frame(const Scale* ax0, const Scale* ax1); Frame(const Frame&); diff --git a/GUI/Model/Device/InstrumentItems.cpp b/GUI/Model/Device/InstrumentItems.cpp index 55f082734f7f0546543462ffbc85862bb523d9fe..2af8e505b71bbfd9689e70e99a33e37aeba7e799 100644 --- a/GUI/Model/Device/InstrumentItems.cpp +++ b/GUI/Model/Device/InstrumentItems.cpp @@ -414,13 +414,13 @@ Frame SpecularInstrumentItem::makeFrame() const return Frame({}); Scale* ax0 = pointwise_axis->axis()->clone(); std::vector<const Scale*> f{ax0}; - return Frame(std::move(f)); + return Frame(f); } Scale axis = axis_item->makeScale("alpha_i (rad)"); std::vector<const Scale*> f{axis.clone()}; - return Frame(std::move(f)); + return Frame(f); } ISimulation* SpecularInstrumentItem::createSimulation(const MultiLayer& sample) const @@ -510,7 +510,7 @@ Frame DepthprobeInstrumentItem::makeFrame() const Scale xAxis = axis_item->makeScale("alpha_i (rad)"); Scale zAxis = m_zAxis.createAxis("z (nm)"); std::vector<const Scale*> axes{xAxis.clone(), zAxis.clone()}; - return Frame(std::move(axes)); + return Frame(axes); } ISimulation* DepthprobeInstrumentItem::createSimulation(const MultiLayer& sample) const diff --git a/auto/Wrap/libBornAgainBase.py b/auto/Wrap/libBornAgainBase.py index 9b51f55352d0e85c7b88174ab03cd0e03d968794..309ad1a0dc2d7c90fd1f33e1b0b3bc2c79a199b6 100644 --- a/auto/Wrap/libBornAgainBase.py +++ b/auto/Wrap/libBornAgainBase.py @@ -1914,7 +1914,7 @@ class Frame(object): def __init__(self, *args): r""" - __init__(Frame self, CloneableVector< Scale const > axes) -> Frame + __init__(Frame self, CloneableVector< Scale const > const & axes) -> Frame __init__(Frame self, Scale ax0) -> Frame __init__(Frame self, Scale ax0, Scale ax1) -> Frame __init__(Frame self, Frame arg2) -> Frame diff --git a/auto/Wrap/libBornAgainBase_wrap.cpp b/auto/Wrap/libBornAgainBase_wrap.cpp index 916dbfbd20547bb11e32d346852786cd9c4fcae8..366b79d563a1daf180bc11727923141101bae317 100644 --- a/auto/Wrap/libBornAgainBase_wrap.cpp +++ b/auto/Wrap/libBornAgainBase_wrap.cpp @@ -26380,28 +26380,23 @@ fail: SWIGINTERN PyObject *_wrap_new_Frame__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; - SwigValueWrapper< CloneableVector< Scale const > > arg1 ; - void *argp1 ; + CloneableVector< Scale const > *arg1 = 0 ; + void *argp1 = 0 ; int res1 = 0 ; Frame *result = 0 ; if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; - { - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_CloneableVectorT_Scale_const_t, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Frame" "', argument " "1"" of type '" "CloneableVector< Scale const >""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Frame" "', argument " "1"" of type '" "CloneableVector< Scale const >""'"); - } else { - CloneableVector< Scale const > * temp = reinterpret_cast< CloneableVector< Scale const > * >(argp1); - arg1 = *temp; - if (SWIG_IsNewObj(res1)) delete temp; - } + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_CloneableVectorT_Scale_const_t, 0 | 0); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Frame" "', argument " "1"" of type '" "CloneableVector< Scale const > const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Frame" "', argument " "1"" of type '" "CloneableVector< Scale const > const &""'"); } + arg1 = reinterpret_cast< CloneableVector< Scale const > * >(argp1); { try { - result = (Frame *)new Frame(arg1); + result = (Frame *)new Frame((CloneableVector< Scale const > const &)*arg1); } catch (const std::exception& ex) { // message shown in the Python interpreter const std::string msg { @@ -26572,7 +26567,7 @@ SWIGINTERN PyObject *_wrap_new_Frame(PyObject *self, PyObject *args) { fail: SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_Frame'.\n" " Possible C/C++ prototypes are:\n" - " Frame::Frame(CloneableVector< Scale const >)\n" + " Frame::Frame(CloneableVector< Scale const > const &)\n" " Frame::Frame(Scale const *)\n" " Frame::Frame(Scale const *,Scale const *)\n" " Frame::Frame(Frame const &)\n"); @@ -29706,7 +29701,7 @@ static PyMethodDef SwigMethods[] = { { "EquiDivision", _wrap_EquiDivision, METH_VARARGS, "EquiDivision(std::string name, size_t N, double start, double end) -> Scale"}, { "EquiScan", _wrap_EquiScan, METH_VARARGS, "EquiScan(std::string name, size_t N, double start, double end) -> Scale"}, { "new_Frame", _wrap_new_Frame, METH_VARARGS, "\n" - "Frame(CloneableVector< Scale const > axes)\n" + "Frame(CloneableVector< Scale const > const & axes)\n" "Frame(Scale ax0)\n" "Frame(Scale ax0, Scale ax1)\n" "new_Frame(Frame arg1) -> Frame\n"