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