DCMTK
Version 3.6.1 20120515
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 | |
Public Member Functions | |
OFVector () | |
default constructor. | |
OFVector (const OFVector &other) | |
copy constructor. | |
OFVector (size_type n, const T &v=T()) | |
construct an OFVector with predefined content. | |
OFVector (const_iterator from, const_iterator to) | |
construct an OFVector from a range of iterators. | |
~OFVector () | |
destructor. | |
OFVector & | operator= (const OFVector &other) |
assignment operator. | |
void | swap (OFVector &other) |
swap this vector's content with some other vector. | |
iterator | begin () |
get an iterator for the first element in this object. | |
const_iterator | begin () const |
get an iterator for the first element in this object. | |
iterator | end () |
get an iterator that points past the last valid object. | |
const_iterator | end () const |
get an iterator that points past the last valid object. | |
size_type | size () const |
get the size of this OFVector. | |
OFBool | empty () const |
check wether this OFVector is empty. | |
void | clear () |
clear this OFVector. | |
void | erase (iterator it) |
removes an entry from this OFVector. | |
iterator | insert (iterator it, const T &v) |
insert an entry in this OFVector. | |
template<class InputIterator > | |
void | insert (iterator it, InputIterator from, InputIterator to) |
insert a range of elements in this OFVector. | |
void | push_back (const T &v) |
insert an entry at the end of this object | |
void | pop_back () |
remove the last entry in this object | |
T & | operator[] (size_type i) |
access an entry by index. | |
const T & | operator[] (size_type i) const |
access an entry by index. | |
T & | at (size_type i) |
access an entry by index. | |
const T & | at (size_type i) const |
access an entry by index. | |
void | resize (size_type n, T v=T()) |
resize this OFVector. | |
void | reserve (size_type n) |
reserves enough space for the given number of elements. | |
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_. |
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 |
OFVector< T >::OFVector | ( | const_iterator | from, |
const_iterator | to | ||
) | [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 |
get an iterator for the first element in this object.
const_iterator OFVector< T >::begin | ( | ) | const [inline] |
get an iterator for the first element in this object.
clear this OFVector.
The existing content will be freed and all iterators become invalid.
get an iterator that points past the last valid object.
const_iterator OFVector< T >::end | ( | ) | const [inline] |
get an iterator that points past the last valid object.
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 |
insert an entry at the end of this object
v | the value to insert |
get the size of this OFVector.
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.