BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
A vector of unique pointers to objects that are cloneable.
Equips vector<unique_ptr<T>> with copy constructor. For use with polymorphic objects, or in pimpl idiom. The objects pointed to must posses a clone() function.
Definition at line 35 of file OwningVector.h.
Public Types | |
using | ConstIterator = typename std::vector< T * >::const_iterator |
using | Iterator = typename std::vector< T * >::iterator |
Public Member Functions | |
OwningVector ()=default | |
OwningVector (const OwningVector &other) | |
Constructor that clones elements in given vector. More... | |
OwningVector (const std::vector< T * > &v) | |
Constructor that takes over ownership of elements in given vector. More... | |
~OwningVector () | |
T *const & | at (int i) const |
const T * | back () const |
Iterator | begin () |
ConstIterator | begin () const |
void | clear () |
std::vector< T * > | cloned_vector () const |
std::vector< const T * > | const_vector () const |
void | emplace_back (T *e) |
bool | empty () const |
Iterator | end () |
ConstIterator | end () const |
OwningVector & | operator= (const OwningVector &other) |
T *const & | operator[] (int i) const |
size_t | size () const |
Private Attributes | |
std::vector< T * > | m_v |
using OwningVector< T >::ConstIterator = typename std::vector<T*>::const_iterator |
Definition at line 90 of file OwningVector.h.
using OwningVector< T >::Iterator = typename std::vector<T*>::iterator |
Definition at line 89 of file OwningVector.h.
|
default |
|
inline |
Constructor that takes over ownership of elements in given vector.
Definition at line 39 of file OwningVector.h.
References OwningVector< T >::m_v.
|
inline |
Constructor that clones elements in given vector.
Definition at line 46 of file OwningVector.h.
References OwningVector< T >::m_v, and OwningVector< T >::size().
|
inline |
Definition at line 52 of file OwningVector.h.
References OwningVector< T >::clear().
|
inline |
Definition at line 73 of file OwningVector.h.
References OwningVector< T >::m_v.
Referenced by Frame::axis(), MultiLayer::layer(), MultiLayer::layerInterface(), DetectorMask::patternAt(), Frame::xAxis(), and Frame::yAxis().
|
inline |
Definition at line 74 of file OwningVector.h.
References OwningVector< T >::m_v.
Referenced by MultiLayer::addLayerWithTopRoughness().
|
inline |
|
inline |
|
inline |
Definition at line 63 of file OwningVector.h.
References OwningVector< T >::m_v.
Referenced by OwningVector< T >::~OwningVector(), and IDetector::clear().
|
inline |
Definition at line 81 of file OwningVector.h.
References OwningVector< T >::m_v.
Referenced by Frame::cloned_axes().
|
inline |
Definition at line 76 of file OwningVector.h.
References OwningVector< T >::m_v.
|
inline |
Definition at line 62 of file OwningVector.h.
References OwningVector< T >::m_v.
Referenced by ParticleLayout::addAndRegisterAbstractParticle(), CoordSystem2D::addAxisData(), IDetector::addDetAxis(), MultiLayer::addInterface(), MultiLayer::addLayer(), DetectorMask::addMask(), ParticleComposition::addParticle(), and IDetector::axesClippedToRegionOfInterest().
|
inline |
Definition at line 71 of file OwningVector.h.
References OwningVector< T >::m_v.
Referenced by IDetector::hasExplicitRegionOfInterest(), DetectorMask::hasMasks(), and DetectorMask::process_masks().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 70 of file OwningVector.h.
References OwningVector< T >::m_v.
Referenced by ImageCoords::ImageCoords(), OwningVector< T >::OwningVector(), SphericalCoords::SphericalCoords(), IDetector::axesClippedToRegionOfInterest(), IDetector::axisBinIndex(), CoordSystem2D::axisSize(), CoordSystem2D::calculateMax(), ParticleComposition::clone(), IDetector::hasExplicitRegionOfInterest(), ParticleComposition::nbrParticles(), MultiLayer::nodeChildren(), MultiLayer::numberOfLayers(), DetectorMask::numberOfMasks(), DetectorMask::process_masks(), Frame::projectedIndex(), Frame::projectedSize(), Frame::rank(), IDetector::rank(), CoordSystem2D::rank(), IDetector::regionOfInterestBounds(), IDetector::sizeOfExplicitRegionOfInterest(), and Frame::toGlobalIndex().
|
private |
Definition at line 98 of file OwningVector.h.
Referenced by OwningVector< T >::OwningVector(), OwningVector< T >::at(), OwningVector< T >::back(), OwningVector< T >::begin(), OwningVector< T >::clear(), OwningVector< T >::cloned_vector(), OwningVector< T >::const_vector(), OwningVector< T >::emplace_back(), OwningVector< T >::empty(), OwningVector< T >::end(), OwningVector< T >::operator=(), OwningVector< T >::operator[](), and OwningVector< T >::size().