Class Avogadro::Core::Array#
-
template<typename T>
class Array# Base class for array containers.
This templated class gives us a container with copy-on-write semantics, allowing for functions to effectively share data without exposing access or copying large amounts of data until the container is changed.
All const functions can be called without copying any data, but a call to a non-const function will trigger a detach call. This is a no-op when the reference count is 1, and will perform a deep copy when the reference count is greater than 1.
Unnamed Group
Public Functions
-
inline Array()#
Constructors for new containers.
-
template<typename InputIterator>
inline Array(InputIterator first, InputIterator last)#
-
inline Array(const Array &other)#
Copy constructor, note the copy made of the internal data of other.
-
inline ~Array()#
-
inline void detachWithCopy()#
Explicitly detach from any other implicitly shared containers. This is not normally necessary, but can be useful when you want to ensure you have a copy of all data.
-
inline void detach()#
Explicitly detach from any other implicitly shared containers. This version does not copy the data.
-
inline size_t size() const#
-
inline size_t max_size() const#
-
inline bool empty() const#
-
inline size_t capacity() const#
-
inline void reserve(const size_t &sz)#
-
inline void clear()#
-
inline const_iterator begin() const#
-
inline const_iterator end() const#
-
inline const_reverse_iterator rbegin() const#
-
inline const_reverse_iterator rend() const#
-
inline reverse_iterator rbegin()#
-
inline reverse_iterator rend()#
-
inline const_reference front() const#
-
inline const_reference back() const#
-
template<class InputIterator>
inline void assign(InputIterator first, InputIterator last)#
-
inline void assign(size_type n, const value_type &val)#
-
inline void pop_back()#
-
inline iterator insert(iterator position, const value_type &val)#
-
inline void insert(iterator position, size_type n, const value_type &val)#
-
template<class InputIterator>
inline void insert(iterator position, InputIterator first, InputIterator last)#
-
inline void swapAndPop(Index index)#
- Parameters:
index – array position to delete if the index is valid swap it with the last position and pop back. This function does not preserve the elements order.
-
inline Array()#