Skip to content
Snippets Groups Projects
Commit a42ed471 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Layer: use OwningVector

parent d865a2bd
No related branches found
No related tags found
1 merge request!1017consequential use of OwningVector
...@@ -42,8 +42,8 @@ Layer* Layer::clone() const ...@@ -42,8 +42,8 @@ Layer* Layer::clone() const
std::vector<const INode*> Layer::nodeChildren() const std::vector<const INode*> Layer::nodeChildren() const
{ {
std::vector<const INode*> result; std::vector<const INode*> result;
for (const auto& layout : m_layouts) for (const auto* layout : m_layouts)
result.push_back(layout.get()); result.push_back(layout);
return result; return result;
} }
...@@ -55,8 +55,8 @@ void Layer::addLayout(const ParticleLayout& layout) ...@@ -55,8 +55,8 @@ void Layer::addLayout(const ParticleLayout& layout)
std::vector<const ParticleLayout*> Layer::layouts() const std::vector<const ParticleLayout*> Layer::layouts() const
{ {
std::vector<const ParticleLayout*> result; std::vector<const ParticleLayout*> result;
for (const auto& layout : m_layouts) for (const auto* layout : m_layouts)
result.push_back(layout.get()); result.push_back(layout);
return result; return result;
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define BORNAGAIN_SAMPLE_MULTILAYER_LAYER_H #define BORNAGAIN_SAMPLE_MULTILAYER_LAYER_H
#include "Sample/Material/Material.h" #include "Sample/Material/Material.h"
#include "Base/Types/OwningVector.h"
#include "Sample/Scattering/ISampleNode.h" #include "Sample/Scattering/ISampleNode.h"
class ParticleLayout; class ParticleLayout;
...@@ -47,10 +48,10 @@ public: ...@@ -47,10 +48,10 @@ public:
std::string validate() const override; std::string validate() const override;
private: private:
Material m_material; //!< material Material m_material; //!< material
R3 m_B_field; //!< cached value of magnetic induction R3 m_B_field; //!< cached value of magnetic induction
double m_thickness; //!< layer thickness in nanometers double m_thickness; //!< layer thickness in nanometers
std::vector<std::unique_ptr<ParticleLayout>> m_layouts; //!< independent layouts in this layer OwningVector<ParticleLayout> m_layouts; //!< independent layouts in this layer
unsigned int m_n_slices = 1; //!< number of slices to create for graded layer approach unsigned int m_n_slices = 1; //!< number of slices to create for graded layer approach
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment