#include <ustl.h>
Inheritance diagram for ustl::vector< T >:

Public Types | |
| typedef T | value_type |
| typedef value_type * | pointer |
| typedef const value_type * | const_pointer |
| typedef value_type & | reference |
| typedef const value_type & | const_reference |
| typedef pointer | iterator |
| typedef const_pointer | const_iterator |
|
typedef ::ustl::reverse_iterator< iterator > | reverse_iterator |
|
typedef ::ustl::reverse_iterator< const_iterator > | const_reverse_iterator |
Public Member Functions | |
| vector (void) | |
| Initializes empty vector. | |
| vector (size_type n) | |
Initializes a vector of size n. | |
| vector (size_type n, const T &v) | |
Copies n elements from v. | |
| vector (const vector< T > &v) | |
Copies v. | |
| vector (const_iterator i1, const_iterator i2) | |
Copies range [i1, i2]. | |
| virtual | ~vector (void) |
| const vector< T > & | operator= (const vector< T > &v) |
Copies contents of v. | |
| void | reserve (size_type n) |
Allocates space for at least n elements. | |
| void | resize (size_type n) |
Resizes the vector to contain n elements. | |
| size_type | capacity (void) const |
| Returns the number of bytes allocated. | |
| size_type | size (void) const |
| Returns the size of the block. | |
| iterator | begin (void) |
| Returns the pointer to the first element. | |
| const_iterator | begin (void) const |
| Returns the pointer to the first element. | |
| iterator | end (void) |
| Returns the pointer to the last element. | |
| const_iterator | end (void) const |
| Returns the pointer to the last element. | |
| reverse_iterator | rbegin (void) |
| Returns the reverse iterator to the last element. | |
| const_reverse_iterator | rbegin (void) const |
| Returns the reverse iterator to the last element. | |
| reverse_iterator | rend (void) |
| Returns the reverse iterator to the first element. | |
| const_reverse_iterator | rend (void) const |
| Returns the reverse iterator to the first element. | |
| reference | at (size_type i) |
| const_reference | at (size_type i) const |
| reference | operator[] (size_type i) |
| const_reference | operator[] (size_type i) const |
| reference | front (void) |
| Returns the reference to the first element. | |
| const_reference | front (void) const |
| Returns the const reference to the first element. | |
| reference | back (void) |
| Returns the reference to the last element. | |
| const_reference | back (void) const |
| Returns the const reference to the last element. | |
| void | push_back (const T &v=T()) |
Inserts value v at the end of the vector. | |
| void | assign (const_iterator i1, const_iterator i2) |
Copies the range [i1, i2]. | |
| void | assign (size_type n, const T &v) |
Copies n elements with value v. | |
| iterator | insert (iterator ip, const T &v=T()) |
Inserts value v at offset ip. | |
| iterator | insert (iterator ip, size_type n, const T &v) |
Inserts n elements with value v at offsets ip. | |
| iterator | insert (iterator ip, const_iterator i1, const_iterator i2) |
Inserts range [i1, i2] at offset ip. | |
| iterator | erase (iterator ep, size_type n=1) |
Removes count elements at offset ep. | |
| iterator | erase (iterator ep1, iterator ep2) |
Removes elements from ep1 to ep2. | |
Protected Member Functions | |
| virtual void | constructBlock (void *p, size_type s) const |
| Calls T() for every element. Because storage is allocated by malloc() in memblock::Reserve(), the constructors must be explicitly called here. | |
| virtual void | destructBlock (void *p, size_type s) const |
| Calls ~T() for every element. Because storage is deallocated by free() in memblock::Link(), the destructors must be explicitly called here. This function must also be called from the destructor of this class because it is virtual and cannot be called from ~memblock(). | |
| virtual size_type | elementSize (void) const |
| Returns the size of the atomic element in the block, if any. | |
| size_type | elementBytes (size_type n) const |
In this design elements frequently undergo BITWISE COPY! Don't put it in here if it doesn't support it.
|
||||||||||
|
Destructor Here the class must call deallocate, which is overloaded in this template to call destructors on all the elements. ~memblock does this too, but by the time the code gets there, the destructBlock overload is gone. |