15 #ifndef BORNAGAIN_BASE_TYPES_SAFEPOINTERVECTOR_H
16 #define BORNAGAIN_BASE_TYPES_SAFEPOINTERVECTOR_H
29 typedef typename std::vector<T*>::iterator
iterator;
61 m_pointers.push_back((*it)->clone());
76 m_pointers.push_back((*it)->clone());
84 m_pointers = std::move(right.m_pointers);
85 right.m_pointers.clear();
91 iterator it = std::find(m_pointers.begin(), m_pointers.end(), pointer);
92 if (it == m_pointers.end())
101 for (
iterator it = begin(); it != end(); ++it)
A vector of pointers, owned by *this, with methods to handle them safely.
const T * operator[](size_t index) const
const_iterator begin() const
SafePointerVector(const SafePointerVector &other)
SafePointerVector & operator=(const SafePointerVector &right)
const_iterator end() const
std::vector< T * >::const_iterator const_iterator
void push_back(T *pointer)
std::vector< T * > m_pointers
T * operator[](size_t index)
SafePointerVector(SafePointerVector &&other)
bool deleteElement(T *pointer)
std::vector< T * >::iterator iterator
SafePointerVector & operator=(SafePointerVector &&right)