#include <CCVector.h>
Public Types | |
typedef std::vector< T >::iterator | iterator |
typedef std::vector< T > ::const_iterator | const_iterator |
typedef std::vector< T > ::reverse_iterator | reverse_iterator |
typedef std::vector< T > ::const_reverse_iterator | const_reverse_iterator |
Public Member Functions | |
iterator | begin () |
var | begin () |
const_iterator | begin () const |
local | begin () |
iterator | end () |
var | end () |
local | end () |
const_iterator | end () const |
local | end () |
const_iterator | cbegin () const |
var | cbegin () |
local | cbegin () |
const_iterator | cend () const |
var | cend () |
local | cend () |
reverse_iterator | rbegin () |
local | rbegin () |
const_reverse_iterator | rbegin () const |
local | rbegin () |
reverse_iterator | rend () |
local | rend () |
const_reverse_iterator | rend () const |
local | rend () |
const_reverse_iterator | crbegin () const |
local | crbegin () |
const_reverse_iterator | crend () const |
local | crend () |
Vector () | |
Constructor. More... | |
Vector () | |
Constructor. More... | |
Vector () | |
Constructor. More... | |
Vector (ssize_t capacity) | |
Constructor with a capacity. More... | |
Vector ( var capacity) | |
Constructor with a capacity. More... | |
Vector ( local capacity) | |
Constructor with a capacity. More... | |
~Vector () | |
Destructor. More... | |
~Vector () | |
Destructor. More... | |
~Vector () | |
Destructor. More... | |
Vector (const Vector< T > &other) | |
Copy constructor. More... | |
Vector ( var other) | |
Copy constructor. More... | |
Vector ( local other) | |
Copy constructor. More... | |
Vector (Vector< T > &&other) | |
Move constructor. More... | |
Vector< T > & | operator= (const Vector< T > &other) |
Copy assignment operator. More... | |
var | operator= ( var other) |
Copy assignment operator. More... | |
local | operator= ( local other) |
Copy assignment operator. More... | |
Vector< T > & | operator= (Vector< T > &&other) |
Move assignment operator. More... | |
var | operator= ( var other) |
Move assignment operator. More... | |
local | operator= ( local other) |
Move assignment operator. More... | |
void | reserve (ssize_t n) |
Request a change in capacity. More... | |
var | reserve ( var n) |
Request a change in capacity. More... | |
local | reserve ( local n) |
Request a change in capacity. More... | |
ssize_t | capacity () const |
Returns the size of the storage space currently allocated for the vector, expressed in terms of elements. More... | |
ssize_t | size () const |
Returns the number of elements in the vector. More... | |
bool | empty () const |
Returns whether the vector is empty (i.e. More... | |
var | empty () |
Returns whether the vector is empty (i.e. More... | |
local | empty () |
Returns whether the vector is empty (i.e. More... | |
ssize_t | max_size () const |
Returns the maximum number of elements that the vector can hold. More... | |
ssize_t | getIndex (T object) const |
Returns index of a certain object, return UINT_MAX if doesn't contain the object. More... | |
var | getIndex ( var object) |
Returns index of a certain object, return UINT_MAX if doesn't contain the object. More... | |
local | getIndex ( local object) |
Returns index of a certain object, return UINT_MAX if doesn't contain the object. More... | |
const_iterator | find (T object) const |
Find the object in the vector. More... | |
iterator | find (T object) |
T | at (ssize_t index) const |
Returns the element at position 'index' in the vector. More... | |
var | at ( var index) |
Returns the element at position 'index' in the vector. More... | |
local | at ( local index) |
Returns the element at position 'index' in the vector. More... | |
T | front () const |
Returns the first element in the vector. More... | |
T | back () const |
Returns the last element of the vector. More... | |
var | back () |
Returns the last element of the vector. More... | |
local | back () |
Returns the last element of the vector. More... | |
T | getRandomObject () const |
Returns a random element of the vector. More... | |
var | getRandomObject () |
Returns a random element of the vector. More... | |
local | getRandomObject () |
Returns a random element of the vector. More... | |
bool | contains (T object) const |
Returns a Boolean value that indicates whether object is present in vector. More... | |
var | contains ( var object) |
Returns a Boolean value that indicates whether object is present in vector. More... | |
local | contains ( local object) |
Returns a Boolean value that indicates whether object is present in vector. More... | |
bool | equals (const Vector< T > &other) |
Returns true if the two vectors are equal. More... | |
var | equals ( var other) |
Returns true if the two vectors are equal. More... | |
local | equals ( local other) |
Returns true if the two vectors are equal. More... | |
void | pushBack (T object) |
Adds a new element at the end of the vector, after its current last element. More... | |
void | pushBack (const Vector< T > &other) |
Push all elements of an existing vector to the end of current vector. More... | |
var | pushBack ( var other) |
Push all elements of an existing vector to the end of current vector. More... | |
local | pushBack ( local other) |
Push all elements of an existing vector to the end of current vector. More... | |
void | insert (ssize_t index, T object) |
Insert a certain object at a certain index. More... | |
var | insert ( var index, var object) |
Insert a certain object at a certain index. More... | |
local | insert ( local index, local object) |
Insert a certain object at a certain index. More... | |
void | popBack () |
Removes the last element in the vector, effectively reducing the container size by one, decrease the referece count of the deleted object. More... | |
var | popBack () |
Removes the last element in the vector, effectively reducing the container size by one, decrease the referece count of the deleted object. More... | |
local | popBack () |
Removes the last element in the vector, effectively reducing the container size by one, decrease the referece count of the deleted object. More... | |
void | eraseObject (T object, bool removeAll=false) |
Remove a certain object in Vector. More... | |
var | eraseObject ( var object, var false) |
Remove a certain object in Vector. More... | |
local | eraseObject ( local object, local false) |
Remove a certain object in Vector. More... | |
iterator | erase (iterator position) |
Removes from the vector with an iterator. More... | |
iterator | erase (iterator first, iterator last) |
Removes from the vector with a range of elements ( [first, last) ). More... | |
local | erase ( local first, local last) |
Removes from the vector with a range of elements ( [first, last) ). More... | |
iterator | erase (ssize_t index) |
Removes from the vector with an index. More... | |
void | clear () |
Removes all elements from the vector (which are destroyed), leaving the container with a size of 0. More... | |
var | clear () |
Removes all elements from the vector (which are destroyed), leaving the container with a size of 0. More... | |
local | clear () |
Removes all elements from the vector (which are destroyed), leaving the container with a size of 0. More... | |
void | swap (T object1, T object2) |
Swap two elements. More... | |
void | swap (ssize_t index1, ssize_t index2) |
Swap two elements with certain indexes. More... | |
var | swap ( var index1, var index2) |
Swap two elements with certain indexes. More... | |
local | swap ( local index1, local index2) |
Swap two elements with certain indexes. More... | |
void | replace (ssize_t index, T object) |
Replace object at index with another object. More... | |
void | reverse () |
reverses the vector More... | |
var | reverse () |
reverses the vector More... | |
local | reverse () |
reverses the vector More... | |
void | shrinkToFit () |
Shrinks the vector so the memory footprint corresponds with the number of items. More... | |
Protected Member Functions | |
void | addRefForAllObjects () |
Retains all the objects in the vector. More... | |
var | addRefForAllObjects () |
Retains all the objects in the vector. More... | |
local | addRefForAllObjects () |
Retains all the objects in the vector. More... | |
Protected Attributes | |
std::vector< T > | _data |
typedef std::vector<T> ::const_iterator const_iterator |
var const_iterator |
local const_iterator |
typedef std::vector<T> ::const_reverse_iterator const_reverse_iterator |
local const_reverse_iterator |
var iterator |
local iterator |
typedef std::vector<T> ::reverse_iterator reverse_iterator |
var reverse_iterator |
local reverse_iterator |
|
inline |
Constructor.
|
inline |
Constructor.
|
inline |
Constructor.
|
inlineexplicit |
Constructor with a capacity.
|
inlineexplicit |
Constructor with a capacity.
|
inline |
Destructor.
|
inline |
Destructor.
|
inline |
Destructor.
|
inline |
Copy constructor.
|
inline |
Copy constructor.
|
inline |
Move constructor.
|
inline |
Move constructor.
|
inlineprotected |
Retains all the objects in the vector.
|
inlineprotected |
Retains all the objects in the vector.
|
inlineprotected |
Retains all the objects in the vector.
|
inline |
Returns the element at position 'index' in the vector.
|
inline |
Returns the element at position 'index' in the vector.
|
inline |
Returns the element at position 'index' in the vector.
|
inline |
Returns the last element of the vector.
|
inline |
Returns the last element of the vector.
|
inline |
Returns the last element of the vector.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the size of the storage space currently allocated for the vector, expressed in terms of elements.
|
inline |
Returns the size of the storage space currently allocated for the vector, expressed in terms of elements.
|
inline |
Returns the size of the storage space currently allocated for the vector, expressed in terms of elements.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Removes all elements from the vector (which are destroyed), leaving the container with a size of 0.
|
inline |
Removes all elements from the vector (which are destroyed), leaving the container with a size of 0.
|
inline |
Removes all elements from the vector (which are destroyed), leaving the container with a size of 0.
|
inline |
Returns a Boolean value that indicates whether object is present in vector.
|
inline |
Returns a Boolean value that indicates whether object is present in vector.
|
inline |
Returns a Boolean value that indicates whether object is present in vector.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns whether the vector is empty (i.e.
whether its size is 0).
|
inline |
Returns whether the vector is empty (i.e.
whether its size is 0).
|
inline |
Returns whether the vector is empty (i.e.
whether its size is 0).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns true if the two vectors are equal.
|
inline |
Returns true if the two vectors are equal.
|
inline |
Returns true if the two vectors are equal.
Removes from the vector with an iterator.
position | Iterator pointing to a single element to be removed from the vector. |
|
inline |
Removes from the vector with an iterator.
position | Iterator pointing to a single element to be removed from the vector. |
|
inline |
Removes from the vector with an iterator.
position | Iterator pointing to a single element to be removed from the vector. |
Removes from the vector with a range of elements ( [first, last) ).
first | The beginning of the range |
last | The end of the range, the 'last' will not used, it's only for indicating the end of range. |
|
inline |
Removes from the vector with a range of elements ( [first, last) ).
first | The beginning of the range |
last | The end of the range, the 'last' will not used, it's only for indicating the end of range. |
|
inline |
Removes from the vector with a range of elements ( [first, last) ).
first | The beginning of the range |
last | The end of the range, the 'last' will not used, it's only for indicating the end of range. |
Removes from the vector with an index.
index | The index of the element to be removed from the vector. |
|
inline |
Removes from the vector with an index.
index | The index of the element to be removed from the vector. |
|
inline |
Removes from the vector with an index.
index | The index of the element to be removed from the vector. |
|
inline |
Remove a certain object in Vector.
object | The object to be removed. |
removeAll | Whether to remove all elements with the same value. If its value is 'false', it will just erase the first occurrence. |
|
inline |
Remove a certain object in Vector.
object | The object to be removed. |
removeAll | Whether to remove all elements with the same value. If its value is 'false', it will just erase the first occurrence. |
|
inline |
Remove a certain object in Vector.
object | The object to be removed. |
removeAll | Whether to remove all elements with the same value. If its value is 'false', it will just erase the first occurrence. |
|
inline |
Find the object in the vector.
|
inline |
Find the object in the vector.
|
inline |
Find the object in the vector.
|
inline |
|
inline |
|
inline |
|
inline |
Returns the first element in the vector.
|
inline |
Returns the first element in the vector.
|
inline |
Returns the first element in the vector.
|
inline |
Returns index of a certain object, return UINT_MAX if doesn't contain the object.
|
inline |
Returns index of a certain object, return UINT_MAX if doesn't contain the object.
|
inline |
Returns index of a certain object, return UINT_MAX if doesn't contain the object.
|
inline |
Returns a random element of the vector.
|
inline |
Returns a random element of the vector.
|
inline |
Returns a random element of the vector.
|
inline |
Insert a certain object at a certain index.
|
inline |
Insert a certain object at a certain index.
|
inline |
Insert a certain object at a certain index.
|
inline |
Returns the maximum number of elements that the vector can hold.
|
inline |
Returns the maximum number of elements that the vector can hold.
|
inline |
Returns the maximum number of elements that the vector can hold.
|
inline |
Copy assignment operator.
|
inline |
Copy assignment operator.
|
inline |
Move assignment operator.
|
inline |
Move assignment operator.
|
inline |
Removes the last element in the vector, effectively reducing the container size by one, decrease the referece count of the deleted object.
|
inline |
Removes the last element in the vector, effectively reducing the container size by one, decrease the referece count of the deleted object.
|
inline |
Removes the last element in the vector, effectively reducing the container size by one, decrease the referece count of the deleted object.
|
inline |
Adds a new element at the end of the vector, after its current last element.
|
inline |
Adds a new element at the end of the vector, after its current last element.
|
inline |
Adds a new element at the end of the vector, after its current last element.
|
inline |
Push all elements of an existing vector to the end of current vector.
|
inline |
Push all elements of an existing vector to the end of current vector.
|
inline |
Push all elements of an existing vector to the end of current vector.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Replace object at index with another object.
|
inline |
Replace object at index with another object.
|
inline |
Replace object at index with another object.
|
inline |
Request a change in capacity.
capacity | Minimum capacity for the vector. If n is greater than the current vector capacity, the function causes the container to reallocate its storage increasing its capacity to n (or greater). |
|
inline |
Request a change in capacity.
capacity | Minimum capacity for the vector. If n is greater than the current vector capacity, the function causes the container to reallocate its storage increasing its capacity to n (or greater). |
|
inline |
Request a change in capacity.
capacity | Minimum capacity for the vector. If n is greater than the current vector capacity, the function causes the container to reallocate its storage increasing its capacity to n (or greater). |
|
inline |
reverses the vector
|
inline |
reverses the vector
|
inline |
reverses the vector
|
inline |
Shrinks the vector so the memory footprint corresponds with the number of items.
|
inline |
Shrinks the vector so the memory footprint corresponds with the number of items.
|
inline |
Shrinks the vector so the memory footprint corresponds with the number of items.
|
inline |
Returns the number of elements in the vector.
|
inline |
Returns the number of elements in the vector.
|
inline |
Returns the number of elements in the vector.
|
inline |
Swap two elements.
|
inline |
Swap two elements.
|
inline |
Swap two elements.
|
inline |
Swap two elements with certain indexes.
|
inline |
Swap two elements with certain indexes.
|
protected |