|
| | Vector (std::initializer_list< T > list) |
| | Constructor. More...
|
| |
| | Vector (size_t size, size_t increment=1) |
| | Constructor. More...
|
| |
| | Vector (T *array, size_t size, bool owner=true, size_t increment=1) |
| | Constructor. More...
|
| |
|
| virtual int | compare (const Object &rhs) const |
| | Compare with another object. More...
|
| |
| virtual size_t | innerAllocatedSize () const |
| | Get the "inner" allocated size. More...
|
| |
| bool | isOwner () const |
| | Get the owner flag. More...
|
| |
| bool | autoInit () const |
| | Get the autoInit flag. More...
|
| |
| const T * | get () const |
| | Get the associated array. More...
|
| |
| T * | get () |
| | Get the associated array. More...
|
| |
| const T & | get (size_t idx) const |
| | Get a const reference to the object at the given index. More...
|
| |
| const T & | get (int idx) const |
| | get() with int parameter. More...
|
| |
|
bool | empty () const |
| | Is the sequence empty?
|
| |
| size_t | length () const |
| | Get the size of the sequence. More...
|
| |
| size_t | size () const |
| | Get the size of the sequence. More...
|
| |
| size_t | increment () const |
| | Get the growth increment. More...
|
| |
|
| const_iterator | begin () const |
| | Get begin iterator (const version). More...
|
| |
| const_iterator | end () const |
| | Get end iterator (const version). More...
|
| |
| const_iterator | cbegin () |
| | Get begin iterator (const version). More...
|
| |
| const_iterator | cend () |
| | Get end iterator (const version). More...
|
| |
| iterator | begin () |
| | Get begin iterator. More...
|
| |
| iterator | end () |
| | Get end iterator. More...
|
| |
|
| size_t | indexOf (const_iterator it) const |
| | Convert iterator to index. More...
|
| |
| size_t | indexOf (iterator it) |
| | Convert iterator to index. More...
|
| |
|
| void | clear () |
| | Empty the sequence. More...
|
| |
| void | excise () |
| | Empty the sequence, delete the allocated array (if isOwner()) and set it to nullptr. More...
|
| |
| void | economize () |
| | Make the allocation exactly large enough to contain the sequence. More...
|
| |
| virtual void | steal (Object &rhs) |
| | "Steal" the internal representation from another instance. More...
|
| |
| virtual void | copy (const Object &) |
| | Copy another instance. More...
|
| |
| void | copy (size_t idx, const Vector< T > &src, size_t srcBegin=0, size_t srcEnd=size_t_max) |
| | Copy (part of) another vector. More...
|
| |
| void | copy (size_t idx, const T *src, size_t srcBegin, size_t srcEnd) |
| | Copy (part of) the given sequence. More...
|
| |
| void | copy (size_t idx, std::initializer_list< T > list) |
| | Copy an initializer_list into this sequence. More...
|
| |
| void | move (size_t idx, const Vector< T > &src, size_t srcBegin=0, size_t srcEnd=size_t_max) |
| | Move (part of) another vector. More...
|
| |
| void | move (size_t idx, T *src, size_t srcBegin, size_t srcEnd) |
| | Move (part of) the given sequence. More...
|
| |
| virtual void | serialize (Stream &stream, uint_t io, uint_t mode=ser_default) |
| | Serialize to or from a stream. More...
|
| |
| void | setOwner (bool owner) |
| | Set the ownership flag. More...
|
| |
| void | assertOwner () |
| | Ensure that self owns the allocation. More...
|
| |
| void | assertOwner (size_t allocSize) |
| | Ensure that self owns the allocation. More...
|
| |
| void | assertOwner (size_t allocSize, size_t increment) |
| | Ensure that self owns the allocation. More...
|
| |
| T & | get (size_t idx) |
| | Get a reference to the object at the given index. More...
|
| |
| T & | get (int idx) |
| | get() with int parameter. More...
|
| |
| void | setSize (size_t size) |
| | Set the size of the sequence. More...
|
| |
| void | grow (size_t size) |
| | Ensure the sequence is no smaller than the given size. More...
|
| |
| void | grow (size_t size, size_t increment) |
| | Ensure the sequence is no smaller than the given size. More...
|
| |
| void | reserve (size_t allocSize) |
| | Reserve allocation space. More...
|
| |
| void | reserve (size_t allocSize, size_t increment) |
| | Reserve allocation space. More...
|
| |
| void | setAutoInit (bool autoInit) |
| | Set the autoInit flag. More...
|
| |
| void | append (const T &val) |
| | Append an object to the sequence. More...
|
| |
| void | append (const Vector< T > &v) |
| | Append another sequence to this one. More...
|
| |
| void | append (const T *array, size_t arraySize) |
| | Append another sequence to this one. More...
|
| |
| void | append (std::initializer_list< T > list) |
| | Append another sequence to this one. More...
|
| |
| void | insert (size_t idx, size_t num) |
| | Insert uninitialized objects in the range [idx,idx+num). More...
|
| |
| void | insert (size_t idx, size_t num, const T &val) |
| | Insert objects into the sequence. More...
|
| |
| void | insert (size_t idx, size_t num, const T *val) |
| | Insert objects into the sequence. More...
|
| |
| void | insert (size_t idx, const T *array, size_t arraySize) |
| | Insert another sequence into this one. More...
|
| |
| void | insert (size_t idx, std::initializer_list< T > list) |
| | Insert another sequence into this one. More...
|
| |
| void | remove (size_t idx, size_t num) |
| | Remove objects from the sequence. More...
|
| |
| void | relocate (size_t destIdx, size_t srcIdx) |
| | Relocate one object within the sequence. More...
|
| |
| void | reverse (size_t idx, size_t num) |
| | Reverse the order of the objects in the sequence. More...
|
| |
| void | set (T *array, size_t size) |
| | clear(), then set the given array/size. More...
|
| |
| void | set (T *array, size_t size, bool owner, size_t increment) |
| | clear(), then set the given array/size and owner flag. More...
|
| |
| void | set (const T &val) |
| | Assign val to all objects in the sequence. More...
|
| |
| void | set (size_t idx, size_t num, const T &val) |
| | Assign a value to objects in the sequence. More...
|
| |
| void | set (size_t idx, const T &val) |
| | Set the value of the object at the given index. More...
|
| |
| void | setIncrement (size_t increment) |
| | Set the growth increment. More...
|
| |
| void | swap (size_t i, size_t j) |
| | Swap the objects at the given indexes. More...
|
| |
|
void | swap (size_t i, size_t j, size_t n) |
| | Swap the sub-arrays described by the index ranges [i, i + n) and [j, j + n).
|
| |
|
| T & | operator[] (size_t idx) |
| | Array access operator. More...
|
| |
| const T & | operator[] (size_t idx) const |
| | Array access operator. More...
|
| |
| T & | operator[] (int idx) |
| | Same as above, but takes an int parameter. More...
|
| |
| const T & | operator[] (int idx) const |
| | Same as above, but takes an int parameter. More...
|
| |
| | operator const T * () const |
| | Conversion to const T*. More...
|
| |
| | operator const T * () |
| | Conversion to const T*. More...
|
| |
| | operator T* () |
| | Conversion to T*. More...
|
| |
| | operator const void * () const |
| | Conversion to const void*. More...
|
| |
| | operator const void * () |
| | Conversion to const void*. More...
|
| |
| | operator void * () |
| | Conversion to void*. More...
|
| |
| T * | operator+ (ssize_t n) |
| | Pointer addition (ssize_t argument). More...
|
| |
| const T * | operator+ (ssize_t n) const |
| | Pointer addition (ssize_t argument). More...
|
| |
| T * | operator+ (size_t n) |
| | Pointer addition (size_t argument). More...
|
| |
| const T * | operator+ (size_t n) const |
| | Pointer addition (size_t argument). More...
|
| |
| void | clear () |
| | Revert to initial state. More...
|
| |
| virtual void | vclone (const Object &rhs) |
| | Make an exact copy of another instance. More...
|
| |
| virtual void | dump (Stream &os, uint_t level=uint_t_max) const |
| | Dump a human-readable representation of self to the given output stream. More...
|
| |
| void | dumpWithClassName (Stream &os, uint_t indent=4, uint_t level=uint_t_max) const |
| | Front-end for dump() that prints the object's class name. More...
|
| |
| virtual const Object & | getKey () const |
| | Get the key for this object. More...
|
| |
| bool | hasKey () const |
| | Determine whether or not the object has a key. More...
|
| |
| virtual const Object & | getProxiedObject () const |
| | Get the proxied object (= self if none). More...
|
| |
| virtual Object & | getProxiedObject () |
| | Get the proxied object (= self if none). More...
|
| |
| virtual size_t | hash (size_t size) const |
| | Get the hash code for the object. More...
|
| |
| bool | _isA (const RunTimeClass *runTimeClass) const |
| | Determine whether self's class is a descendent of the given class. More...
|
| |
| virtual String | toString () const |
| | Return a string representation of self. More...
|
| |
| | operator String () const |
| | Conversion to String. More...
|
| |
| size_t | allocatedSize () const |
| | Get the total allocated size of this object. More...
|
| |
| virtual void | addOwnedIt (const class FwdIt *it) const |
| | Notify self that it owns the given iterator. More...
|
| |
| virtual void | removeOwnedIt (const class FwdIt *it) const |
| | Notify self that the given owned iterator has been destroyed. More...
|
| |
| bool | operator< (const Object &rhs) const |
| | Less-than operator. More...
|
| |
| bool | operator<= (const Object &rhs) const |
| | Less-than-or-equal-to operator. More...
|
| |
| bool | operator> (const Object &rhs) const |
| | Greater-than operator. More...
|
| |
| bool | operator>= (const Object &rhs) const |
| | Greater-than-or-equal-to operator. More...
|
| |
| bool | operator== (const Object &rhs) const |
| | Equal-to operator. More...
|
| |
| bool | operator!= (const Object &rhs) const |
| | Unequal-to operator. More...
|
| |
| void | serializeIn (Stream &is, uint_t mode=ser_default) |
| | Serialize from an input stream. More...
|
| |
| void | serializeOut (Stream &os, uint_t mode=ser_default) const |
| | Serialize to an output stream. More...
|
| |
| void | serializeOutBoxed (Stream &os, uint_t mode=ser_default) const |
| | Serialize a boxed object to an output stream. More...
|
| |
template<typename T>
class utl::Vector< T >
A sequence of same-type objects.
Attributes
- array : The array of objects.
- size : The size of the sequence (size <= allocSize).
- allocSize : The number of objects that can be stored in the present allocation.
- increment : When the allocation is to be grown, the growth increment determines the amount of growth. For example, if increment = 16, the allocation will always be grown by a multiple of 16. As a special case, if increment = size_t_max, the allocation will be doubled in size until it is >= the required size. The default is to allocate exactly the amount of memory that's immediately required (increment = 1).
- owner flag : If a Vector owns its associated array, it is responsible for deleting the array when appropriate (e.g. upon its destruction).
- autoInit flag : When the sequence grows, newly created objects may optionally be initialized with the default value for the contained type.
- Author
- Adam McKee
Definition at line 14 of file Ordering.h.