DCMTK
Version 3.6.1 20170228
OFFIS DICOM Toolkit
|
this is a resizable array. More...
Public Types | |
typedef T | value_type |
the type of elements that this OFVector stores | |
typedef size_t | size_type |
the type used for sizes and indexes | |
typedef T * | iterator |
the type of mutable iterators on this object | |
typedef const T * | const_iterator |
the type of constant iterators on this object | |
typedef T & | reference |
the type of mutable references on this object | |
typedef const T & | const_reference |
the type of constant references on this object | |
Public Member Functions | |
OFVector () | |
default constructor. More... | |
OFVector (const OFVector &other) | |
copy constructor. More... | |
OFVector (size_type n, const T &v=T()) | |
construct an OFVector with predefined content. More... | |
OFVector (const_iterator from, const_iterator to) | |
construct an OFVector from a range of iterators. More... | |
~OFVector () | |
destructor. More... | |
OFVector & | operator= (const OFVector &other) |
assignment operator. More... | |
void | swap (OFVector &other) |
swap this vector's content with some other vector. More... | |
iterator | begin () |
get an iterator for the first element in this object. More... | |
const_iterator | begin () const |
get an iterator for the first element in this object. More... | |
iterator | end () |
get an iterator that points past the last valid object. More... | |
const_iterator | end () const |
get an iterator that points past the last valid object. More... | |
size_type | size () const |
get the size of this OFVector. More... | |
OFBool | empty () const |
check wether this OFVector is empty. More... | |
void | clear () |
clear this OFVector. More... | |
void | erase (iterator it) |
removes an entry from this OFVector. More... | |
iterator | insert (iterator it, const T &v) |
insert an entry in this OFVector. More... | |
template<class InputIterator > | |
void | insert (iterator it, InputIterator from, InputIterator to) |
insert a range of elements in this OFVector. More... | |
T & | front () |
get a reference to the first element of this vector. More... | |
const T & | front () const |
get a reference to the first element of this vector. More... | |
T & | back () |
get a reference to the last element of this vector. More... | |
const T & | back () const |
get a reference to the last element of this vector. More... | |
void | push_back (const T &v) |
insert an entry at the end of this object More... | |
void | pop_back () |
remove the last entry in this object | |
T & | operator[] (size_type i) |
access an entry by index. More... | |
const T & | operator[] (size_type i) const |
access an entry by index. More... | |
T & | at (size_type i) |
access an entry by index. More... | |
const T & | at (size_type i) const |
access an entry by index. More... | |
void | resize (size_type n, T v=T()) |
resize this OFVector. More... | |
void | reserve (size_type n) |
reserves enough space for the given number of elements. More... | |
Protected Attributes | |
T * | values_ |
array that is used for storing the entries in this OFVector | |
size_type | allocated_ |
the size for which values_ was allocated | |
size_type | size_ |
the number of valid entries in values_. More... | |
this is a resizable array.
You can add and remove elements after it was created and this class will handle all the memory management needed. This implements parts of std::vector's features.
default constructor.
This creates an empty OFVector.
copy constructor.
other | OFVector from which all elements are copied |
|
inline |
construct an OFVector from a range of iterators.
from | first iterator to include |
to | first iterator that should not be included anymore |
destructor.
Frees all memory used by this object.
access an entry by index.
i | index of the element to return |
access an entry by index.
i | index of the element to return |
|
inline |
get a reference to the last element of this vector.
|
inline |
get a reference to the last element of this vector.
get an iterator for the first element in this object.
Referenced by DSRListOfItems< DSRWaveformChannelItem >::addItems(), OFVector< SOPInstanceReferenceMacro * >::erase(), OFVector< SOPInstanceReferenceMacro * >::insert(), OFVector< SOPInstanceReferenceMacro * >::OFVector(), and OFVector< SOPInstanceReferenceMacro * >::operator=().
|
inline |
get an iterator for the first element in this object.
|
inline |
clear this OFVector.
The existing content will be freed and all iterators become invalid.
Referenced by DSRListOfItems< DSRWaveformChannelItem >::getItems(), and OFVector< SOPInstanceReferenceMacro * >::operator=().
get an iterator that points past the last valid object.
Referenced by DSRListOfItems< DSRWaveformChannelItem >::addItems(), OFVector< SOPInstanceReferenceMacro * >::OFVector(), OFVector< SOPInstanceReferenceMacro * >::operator=(), OFVector< SOPInstanceReferenceMacro * >::pop_back(), and OFVector< SOPInstanceReferenceMacro * >::push_back().
|
inline |
get an iterator that points past the last valid object.
removes an entry from this OFVector.
All iterators pointing to the element removed or elements that come behind it in this OFVector will become invalid.
it | iterator for the entry that should be removed. |
Referenced by OFVector< SOPInstanceReferenceMacro * >::pop_back().
|
inline |
get a reference to the first element of this vector.
|
inline |
get a reference to the first element of this vector.
insert an entry in this OFVector.
All iterators for this OFVector become invalid.
it | the new element will be inserted in front of the element to which this iterator points. |
v | the element to insert |
Referenced by OFVector< SOPInstanceReferenceMacro * >::insert(), and OFVector< SOPInstanceReferenceMacro * >::push_back().
assignment operator.
All elements from this object are removed and then a copy of other is made. All iterators to this object will become invalid.
other | OFVector instance to copy elements from. |
access an entry by index.
undefined behavior occurs when the index is out of bounds (bigger than the maximum allowed index).
i | index of the element to return |
access an entry by index.
undefined behavior occurs when the index is out of bounds (bigger than the maximum allowed index).
i | index of the element to return |
|
inline |
insert an entry at the end of this object
v | the value to insert |
Referenced by DSRListOfItems< DSRWaveformChannelItem >::getItems(), OFVector< SOPInstanceReferenceMacro * >::OFVector(), and OFVector< SOPInstanceReferenceMacro * >::operator=().
reserves enough space for the given number of elements.
from now on, no memory allocations will occur as long as this OFVector's size stays below n and clear() is not called.
n | the number of elements for which space should be reserved. |
Referenced by OFVector< SOPInstanceReferenceMacro * >::clear(), DSRListOfItems< DSRWaveformChannelItem >::getItems(), OFVector< SOPInstanceReferenceMacro * >::insert(), OFVector< SOPInstanceReferenceMacro * >::OFVector(), OFVector< SOPInstanceReferenceMacro * >::operator=(), and OFVector< SOPInstanceReferenceMacro * >::resize().
resize this OFVector.
after this call, size() will be n.
n | the new size that this object should use |
v | if any new elements need to be inserted, they get this value. |
Referenced by OFVector< SOPInstanceReferenceMacro * >::OFVector().
get the size of this OFVector.
Referenced by OFVector< SOPInstanceReferenceMacro * >::OFVector(), and OFVector< SOPInstanceReferenceMacro * >::operator=().
swap this vector's content with some other vector.
All iterators will stay valid.
other | object to swap with |
the number of valid entries in values_.
elements past this index have undefined content.
Referenced by OFVector< SOPInstanceReferenceMacro * >::end(), OFVector< SOPInstanceReferenceMacro * >::erase(), OFVector< SOPInstanceReferenceMacro * >::reserve(), OFVector< SOPInstanceReferenceMacro * >::size(), and OFVector< SOPInstanceReferenceMacro * >::swap().