template <class TYPE>

class Vector

Defined at line 55 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

The main templated vector class ensuring type safety

while making use of VectorImpl.

This is the class users want to use.

DO NOT USE: please use std::vector

Public Methods

void clear ()

empty the vector

Defined at line 77 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

size_t size ()

returns number of items in the vector

Defined at line 84 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

bool isEmpty ()

returns whether or not the vector is empty

Defined at line 86 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

size_t capacity ()

returns how many items can be stored without reallocating the backing store

Defined at line 88 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t setCapacity (size_t size)

sets the capacity. capacity can never be reduced less than size()

Defined at line 90 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t resize (size_t size)

set the size of the vector. items are appended with the default

constructor, or removed from the end as needed.

Defined at line 96 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t removeAt (size_t index)

remove one item

Defined at line 174 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

size_t getItemSize ()

for debugging only

Defined at line 187 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

iterator begin ()

Defined at line 197 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

iterator end ()

Defined at line 198 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

const_iterator begin ()

Defined at line 199 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

const_iterator end ()

Defined at line 200 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void reserve (size_t n)

Defined at line 201 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

bool empty ()

Defined at line 202 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void push_back (const TYPE & item)

Defined at line 203 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void push_front (const TYPE & item)

Defined at line 204 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

iterator erase (iterator pos)

Defined at line 205 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void Vector<TYPE> ()

---------------------------------------------------------------------------

No user serviceable parts from here...

---------------------------------------------------------------------------

Defined at line 223 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void Vector<TYPE> (const Vector<TYPE> & rhs)

Defined at line 233 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void Vector<TYPE> (const SortedVector<TYPE> & rhs)

Defined at line 238 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void ~Vector<TYPE> ()

Defined at line 243 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

Vector<TYPE> & operator= (const Vector<TYPE> & rhs)

copy operator

Defined at line 248 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

Vector<TYPE> & operator= (const SortedVector<TYPE> & rhs)

Defined at line 255 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

const TYPE * array ()

read-only C-style access

Defined at line 263 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

TYPE * editArray ()

read-write C-style access

Defined at line 268 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

const TYPE & operator[] (size_t index)

read-only access to an item at a given index

Defined at line 274 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

const TYPE & itemAt (size_t index)

alternate name for operator []

Defined at line 282 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

const TYPE & top ()

stack-usage of the vector. returns the top of the stack (last element)

Defined at line 287 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

TYPE & editItemAt (size_t index)

copy-on write support, grants write access to an item

Defined at line 292 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

TYPE & editTop ()

grants right access to the top of the stack (last element)

Defined at line 297 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t insertVectorAt (const Vector<TYPE> & vector, size_t index)

insert another vector at a given index

Defined at line 302 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t appendVector (const Vector<TYPE> & vector)

append another vector at the end of this one

Defined at line 307 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t insertArrayAt (const TYPE * array, size_t index, size_t length)

insert an array at a given index

Defined at line 312 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t appendArray (const TYPE * array, size_t length)

append an array at the end of this vector

Defined at line 317 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t insertAt (size_t index, size_t numItems)

insert one or several items initialized with their default constructor

Defined at line 342 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t insertAt (const TYPE & prototype_item, size_t index, size_t numItems)

insert one or several items initialized from a prototype item

Defined at line 322 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void pop ()

pop the top of the stack (removes the last element). No-op if the stack's empty

Defined at line 347 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void push ()

pushes an item initialized with its default constructor

Defined at line 352 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void push (const TYPE & item)

pushes an item on the top of the stack

Defined at line 327 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t add ()

same as push() but returns the index the item was added at (or an error)

Defined at line 357 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t add (const TYPE & item)

same as push() but returns the index the item was added at (or an error)

Defined at line 332 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t replaceAt (size_t index)

replace an item with a new one initialized with its default constructor

Defined at line 362 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t replaceAt (const TYPE & item, size_t index)

replace an item with a new one

Defined at line 337 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

ssize_t removeItemsAt (size_t index, size_t count)

remove several items

Defined at line 367 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

status_t sort (compar_t cmp)

Defined at line 372 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

status_t sort (compar_r_t cmp, void * state)

Defined at line 377 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

Protected Methods

void do_construct (void * storage, size_t num)

---------------------------------------------------------------------------

Defined at line 384 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void do_destroy (void * storage, size_t num)

Defined at line 389 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void do_copy (void * dest, const void * from, size_t num)

Defined at line 394 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void do_splat (void * dest, const void * item, size_t num)

Defined at line 399 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void do_move_forward (void * dest, const void * from, size_t num)

Defined at line 404 of file ../../third_party/android/platform/system/core/include/utils/Vector.h

void do_move_backward (void * dest, const void * from, size_t num)

Defined at line 409 of file ../../third_party/android/platform/system/core/include/utils/Vector.h