cocos2d-x
3.3
|
#include <CCArray.h>
Public Member Functions | |
~__Array () | |
NA NA More... | |
bool | init () |
Initializes an array NA NA. More... | |
bool | initWithObject (Ref *object) |
Initializes an array with one object NA NA. More... | |
bool | initWithObjects (Ref *object,...) CC_REQUIRES_NULL_TERMINATION |
Initializes an array with some objects NA NA. More... | |
bool | initWithCapacity (ssize_t capacity) |
Initializes an array with capacity NA NA. More... | |
bool | initWithArray (__Array *otherArray) |
Initializes an array with an existing array NA NA. More... | |
ssize_t | count () const |
Returns element count of the array NA. More... | |
ssize_t | capacity () const |
Returns capacity of the array NA. More... | |
ssize_t | getIndexOfObject (Ref *object) const |
Returns index of a certain object, return UINT_MAX if doesn't contain the object NA NA. More... | |
ssize_t | indexOfObject (Ref *object) const |
NA More... | |
Ref * | getObjectAtIndex (ssize_t index) |
Returns an element with a certain index NA NA. More... | |
Ref * | objectAtIndex (ssize_t index) |
Ref * | getLastObject () |
Returns the last element of the array NA. More... | |
Ref * | lastObject () |
NA More... | |
Ref * | getRandomObject () |
Returns a random element NA NA. More... | |
Ref * | randomObject () |
NA More... | |
bool | containsObject (Ref *object) const |
Returns a Boolean value that indicates whether object is present in array. More... | |
bool | isEqualToArray (__Array *otherArray) |
void | addObject (Ref *object) |
Add a certain object NA. More... | |
void | addObjectsFromArray (__Array *otherArray) |
NA More... | |
void | insertObject (Ref *object, ssize_t index) |
Insert a certain object at a certain index NA. More... | |
void | setObject (Ref *object, ssize_t index) |
sets a certain object at a certain index NA NA More... | |
void | fastSetObject (Ref *object, ssize_t index) |
sets a certain object at a certain index without retaining. More... | |
void | swap (ssize_t indexOne, ssize_t indexTwo) |
NA NA More... | |
void | removeLastObject (bool releaseObj=true) |
Remove last object NA. More... | |
void | removeObject (Ref *object, bool releaseObj=true) |
Remove a certain object NA. More... | |
void | removeObjectAtIndex (ssize_t index, bool releaseObj=true) |
Remove an element with a certain index NA. More... | |
void | removeObjectsInArray (__Array *otherArray) |
Remove all elements NA. More... | |
void | removeAllObjects () |
Remove all objects NA. More... | |
void | fastRemoveObject (Ref *object) |
Fast way to remove a certain object NA. More... | |
void | fastRemoveObjectAtIndex (ssize_t index) |
Fast way to remove an element with a certain index NA. More... | |
void | exchangeObject (Ref *object1, Ref *object2) |
Swap two elements NA. More... | |
void | exchangeObjectAtIndex (ssize_t index1, ssize_t index2) |
Swap two elements with certain indexes NA. More... | |
void | replaceObjectAtIndex (ssize_t index, Ref *object, bool releaseObject=true) |
Replace object at index with another object. More... | |
void | reverseObjects () |
Revers the array NA. More... | |
void | reduceMemoryFootprint () |
virtual void | acceptVisitor (DataVisitor &visitor) |
virtual __Array * | clone () const |
NA NA More... | |
Ref ** | begin () |
NA NA More... | |
Ref ** | end () |
NA NA More... | |
__Array () | |
NA NA More... | |
![]() | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Releases the ownership immediately. More... | |
Ref * | autorelease () |
Releases the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
NA NA More... | |
![]() | |
virtual | ~Clonable () |
NA NA More... | |
Ref * | copy () const |
returns a copy of the Ref. More... | |
Static Public Member Functions | |
static __Array * | create () |
Creates an empty array. More... | |
static __Array * | create (Ref *object,...) CC_REQUIRES_NULL_TERMINATION |
Create an array with objects NA. More... | |
static __Array * | createWithObject (Ref *object) |
Create an array with one object NA. More... | |
static __Array * | createWithCapacity (ssize_t capacity) |
Create an array with a default capacity NA. More... | |
static __Array * | createWithArray (__Array *otherArray) |
Create an array with from an existing array NA. More... | |
static __Array * | createWithContentsOfFile (const std::string &pFileName) |
Generate a Array pointer by file. More... | |
static __Array * | createWithContentsOfFileThreadSafe (const std::string &pFileName) |
Public Attributes | |
ccArray * | data |
Additional Inherited Members | |
![]() | |
Ref () | |
Constructor. More... | |
![]() | |
unsigned int | _referenceCount |
count of references More... | |
~__Array | ( | ) |
NA NA
__Array | ( | ) |
NA NA
|
virtual |
void addObject | ( | Ref * | object | ) |
Add a certain object NA.
void addObjectsFromArray | ( | __Array * | otherArray | ) |
NA
Add all elements of an existing array NA
|
inline |
NA NA
|
inline |
Returns capacity of the array NA.
bool containsObject | ( | Ref * | object | ) | const |
Returns a Boolean value that indicates whether object is present in array.
NA
|
inline |
Returns element count of the array NA.
|
static |
Creates an empty array.
Default capacity is 10 NA NA
Create an array with from an existing array NA.
Create an array with a default capacity NA.
|
static |
Generate a Array pointer by file.
pFileName | The file name of *.plist file |
|
static |
|
inline |
NA NA
Swap two elements with certain indexes NA.
void fastRemoveObject | ( | Ref * | object | ) |
Fast way to remove a certain object NA.
void fastRemoveObjectAtIndex | ( | ssize_t | index | ) |
Fast way to remove an element with a certain index NA.
sets a certain object at a certain index without retaining.
Use it with caution NA NA
Returns index of a certain object, return UINT_MAX if doesn't contain the object NA NA.
|
inline |
Returns the last element of the array NA.
Ref* getRandomObject | ( | ) |
Returns a random element NA NA.
bool init | ( | ) |
Initializes an array NA NA.
bool initWithArray | ( | __Array * | otherArray | ) |
Initializes an array with an existing array NA NA.
bool initWithCapacity | ( | ssize_t | capacity | ) |
Initializes an array with capacity NA NA.
bool initWithObject | ( | Ref * | object | ) |
Initializes an array with one object NA NA.
bool initWithObjects | ( | Ref * | object, |
... | |||
) |
Initializes an array with some objects NA NA.
bool isEqualToArray | ( | __Array * | otherArray | ) |
|
inline |
NA
|
inline |
NA
void reduceMemoryFootprint | ( | ) |
void removeAllObjects | ( | ) |
Remove all objects NA.
void removeLastObject | ( | bool | releaseObj = true | ) |
Remove last object NA.
void removeObject | ( | Ref * | object, |
bool | releaseObj = true |
||
) |
Remove a certain object NA.
void removeObjectAtIndex | ( | ssize_t | index, |
bool | releaseObj = true |
||
) |
Remove an element with a certain index NA.
void removeObjectsInArray | ( | __Array * | otherArray | ) |
Remove all elements NA.
Replace object at index with another object.
NA
void reverseObjects | ( | ) |
Revers the array NA.
ccArray* data |