|
DUECA/DUSIME
|
Variable-sized vector, allocates its for the data from the heap, so not the most efficient for high-rate real-time data sending. More...
Public Types | |
| typedef T | value_type |
| Type of the contained object. | |
| typedef T * | pointer |
| Type of a pointer to the contained object. | |
| typedef T & | reference |
| Type of a reference to the contained object. | |
| typedef const T & | const_reference |
| Type of a reference to the contained object. | |
| typedef const T * | const_pointer |
| Type of a pointer to the contained object. | |
| typedef pointer | iterator |
| Define the iterator type. | |
| typedef const_pointer | const_iterator |
| Define the const iterator type. | |
| typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
| Define the reverse const iterator type. | |
| typedef std::reverse_iterator< iterator > | reverse_iterator |
| Define the reverse iterator type. | |
| typedef std::random_access_iterator_tag | iterator_category |
| Show random access is possible. | |
| typedef ::size_t | size_type |
| Size of the underlying thing. | |
| typedef std::ptrdiff_t | difference_type |
| Pointer difference. | |
Public Member Functions | |
| varvector (size_t N, const T &defval) | |
| constructor with default value for the data More... | |
| varvector (size_t N=0) | |
| constructor without default value for the data More... | |
| varvector (const std::initializer_list< T > &e) | |
| constructor with initializer list | |
| varvector (const varvector< T > &other) | |
| copy constructor; copies the data | |
| template<class InputIt > | |
| varvector (InputIt first, InputIt last) | |
| construct from iterators | |
| ~varvector () | |
| destructor | |
| operator pointer (void) | |
| obtain a pointer directly to the data | |
| operator const_pointer (void) const | |
| obtain a const pointer directly to the data | |
| iterator | begin () |
| more-or-less stl-compatible iterator | |
| iterator | end () |
| more-or-less stl-compatible iterator | |
| const_iterator | begin () const |
| more-or-less stl-compatible iterator | |
| const_iterator | end () const |
| more-or-less stl-compatible iterator | |
| size_t | size () const |
| size of the vector | |
| varvector< T > & | operator= (const varvector< T > &other) |
| assignment operator; dumb delete & copy | |
| varvector< T > & | operator= (const T &val) |
| assignment operator, to value type | |
| bool | operator== (const varvector< T > &other) const |
| equality test | |
| bool | operator!= (const varvector< T > &other) const |
| inequality test | |
| template<typename idx_t > | |
| const T & | operator[] (idx_t ii) const |
| access elements of the vector. More... | |
| template<typename idx_t > | |
| T & | operator[] (idx_t ii) |
| access elements of the vector. More... | |
| void | resize (size_t s, const value_type &val=value_type()) |
| forced resize of the vector | |
| const T * | ptr () const |
| access as const pointer | |
| T * | ptr () |
| access as pointer | |
| void | push_back (const value_type &__x) |
| push_back, really inefficient! | |
| void | pop_back (const value_type &__x) |
| pop_back, really inefficient! | |
| reference | front () |
| access first element | |
| const_reference | front () const |
| access first element | |
| reference | back () |
| access last element | |
| const_reference | back () const |
| access last element | |
Variable-sized vector, allocates its for the data from the heap, so not the most efficient for high-rate real-time data sending.
Also re-sizing is not done efficiently; don't use this as a working space vector.
Implementing most stl-like interfaces
|
inline |
constructor with default value for the data
| N | length of vector |
| defval | default fill value |
|
inline |
constructor without default value for the data
| N | length of vector |
|
inline |
access elements of the vector.
Note that indexing is checked
|
inline |
access elements of the vector.
Note that indexing is checked