cocos2d-x  2.2.3-gd2.113-rev1ec524e
Loading...
Searching...
No Matches
CCArray Class Reference

NA. More...

#include <CCArray.h>

Inheritance diagram for CCArray:
[legend]
Collaboration diagram for CCArray:
[legend]

Public Member Functions

 ~CCArray ()
 NA. More...
 
bool init ()
 Initializes an array NA. More...
 
bool initWithObject (CCObject *pObject)
 Initializes an array with one object NA. More...
 
bool initWithObjects (CCObject *pObject,...)
 Initializes an array with some objects NA. More...
 
bool initWithCapacity (unsigned int capacity)
 Initializes an array with capacity NA. More...
 
bool initWithArray (CCArray *otherArray)
 Initializes an array with an existing array NA. More...
 
unsigned int count () const
 Returns element count of the array. More...
 
unsigned int capacity () const
 Returns capacity of the array. More...
 
unsigned int indexOfObject (CCObject *object) const
 Returns index of a certain object, return UINT_MAX if doesn't contain the object. More...
 
CCObjectobjectAtIndex (unsigned int index)
 Returns an element with a certain index. More...
 
CCObjectlastObject ()
 Returns last element. More...
 
CCObjectrandomObject ()
 Returns a random element. More...
 
bool containsObject (CCObject *object) const
 Returns a Boolean value that indicates whether object is present in array. More...
 
bool isEqualToArray (CCArray *pOtherArray)
 
void addObject (CCObject *object)
 Add a certain object. More...
 
void addObjectsFromArray (CCArray *otherArray)
 Add all elements of an existing array. More...
 
void insertObject (CCObject *object, unsigned int index)
 Insert a certain object at a certain index. More...
 
void removeLastObject (bool bReleaseObj=true)
 Remove last object. More...
 
void removeObject (CCObject *object, bool bReleaseObj=true)
 Remove a certain object. More...
 
void removeObjectAtIndex (unsigned int index, bool bReleaseObj=true)
 Remove an element with a certain index. More...
 
void removeObjectsInArray (CCArray *otherArray)
 Remove all elements. More...
 
void removeAllObjects ()
 Remove all objects. More...
 
void fastRemoveObject (CCObject *object)
 Fast way to remove a certain object. More...
 
void fastRemoveObjectAtIndex (unsigned int index)
 Fast way to remove an element with a certain index. More...
 
void exchangeObject (CCObject *object1, CCObject *object2)
 Swap two elements. More...
 
void exchangeObjectAtIndex (unsigned int index1, unsigned int index2)
 Swap two elements with certain indexes. More...
 
void replaceObjectAtIndex (unsigned int uIndex, CCObject *pObject, bool bReleaseObject=true)
 Replace object at index with another object. More...
 
void reverseObjects ()
 Revers the array. More...
 
void reduceMemoryFootprint ()
 
virtual CCObjectcopyWithZone (CCZone *pZone)
 override functions NA NA More...
 
virtual void acceptVisitor (CCDataVisitor &visitor)
 
 CCArray ()
 NA. More...
 
 CCArray (unsigned int capacity)
 NA. More...
 
- Public Member Functions inherited from CCObject
 CCObject (void)
 
virtual ~CCObject (void)
 NA. More...
 
void release (void)
 
void retain (void)
 
CCObjectautorelease (void)
 
CCObjectcopy (void)
 
bool isSingleReference (void) const
 
unsigned int retainCount (void) const
 
virtual bool isEqual (const CCObject *pObject)
 
virtual void acceptVisitor (CCDataVisitor &visitor)
 
virtual void update (float dt)
 
 CCObject (const CCObject &)
 
CCObjectoperator= (const CCObject &)
 
virtual void encodeWithCoder (DS_Dictionary *)
 
virtual bool canEncode ()
 
CCObjectType getObjType () const
 
virtual int getTag () const
 
virtual void setTag (int nTag)
 
void setObjType (CCObjectType)
 
virtual CCObjectcopyWithZone (CCZone *pZone)
 

Static Public Member Functions

static CCArraycreate ()
 Create an array. More...
 
static CCArraycreate (CCObject *pObject,...)
 Create an array with some objects NA. More...
 
static CCArraycreateWithObject (CCObject *pObject)
 Create an array with one object. More...
 
static CCArraycreateWithCapacity (unsigned int capacity)
 Create an array with capacity. More...
 
static CCArraycreateWithArray (CCArray *otherArray)
 Create an array with an existing array. More...
 
static CCArraycreateWithContentsOfFile (const char *pFileName)
 Generate a CCArray pointer by file. More...
 
static CCArraycreateWithContentsOfFileThreadSafe (const char *pFileName)
 
- Static Public Member Functions inherited from CCObject
static CCObjectcreateWithCoder (DS_Dictionary *)
 

Public Attributes

ccArray * data
 
- Public Attributes inherited from CCObject
unsigned int m_uID
 
int m_nLuaID
 

Additional Inherited Members

- Protected Attributes inherited from CCObject
unsigned int m_uReference
 
unsigned int m_uAutoReleaseCount
 
int m_nTag
 
int m_eObjType
 
unsigned int m_uObjectIdxInArray
 

Detailed Description

NA.

Constructor & Destructor Documentation

◆ ~CCArray()

~CCArray ( )

NA.

◆ CCArray() [1/2]

CCArray ( )

NA.

◆ CCArray() [2/2]

CCArray ( unsigned int  capacity)

NA.

Member Function Documentation

◆ acceptVisitor()

virtual void acceptVisitor ( CCDataVisitor visitor)
virtual

Reimplemented from CCObject.

◆ addObject()

void addObject ( CCObject object)

Add a certain object.

◆ addObjectsFromArray()

void addObjectsFromArray ( CCArray otherArray)

Add all elements of an existing array.

◆ capacity()

unsigned int capacity ( ) const

Returns capacity of the array.

◆ containsObject()

bool containsObject ( CCObject object) const

Returns a Boolean value that indicates whether object is present in array.

◆ copyWithZone()

virtual CCObject * copyWithZone ( CCZone pZone)
virtual

override functions NA NA

Reimplemented from CCCopying.

◆ count()

unsigned int count ( ) const

Returns element count of the array.

◆ create() [1/2]

static CCArray * create ( )
static

Create an array.

◆ create() [2/2]

static CCArray * create ( CCObject pObject,
  ... 
)
static

Create an array with some objects NA.

◆ createWithArray()

static CCArray * createWithArray ( CCArray otherArray)
static

Create an array with an existing array.

◆ createWithCapacity()

static CCArray * createWithCapacity ( unsigned int  capacity)
static

Create an array with capacity.

◆ createWithContentsOfFile()

static CCArray * createWithContentsOfFile ( const char *  pFileName)
static

Generate a CCArray pointer by file.

Parameters
pFileNameThe file name of *.plist file
Returns
The CCArray pointer generated from the file

◆ createWithContentsOfFileThreadSafe()

static CCArray * createWithContentsOfFileThreadSafe ( const char *  pFileName)
static

◆ createWithObject()

static CCArray * createWithObject ( CCObject pObject)
static

Create an array with one object.

◆ exchangeObject()

void exchangeObject ( CCObject object1,
CCObject object2 
)

Swap two elements.

◆ exchangeObjectAtIndex()

void exchangeObjectAtIndex ( unsigned int  index1,
unsigned int  index2 
)

Swap two elements with certain indexes.

◆ fastRemoveObject()

void fastRemoveObject ( CCObject object)

Fast way to remove a certain object.

◆ fastRemoveObjectAtIndex()

void fastRemoveObjectAtIndex ( unsigned int  index)

Fast way to remove an element with a certain index.

◆ indexOfObject()

unsigned int indexOfObject ( CCObject object) const

Returns index of a certain object, return UINT_MAX if doesn't contain the object.

◆ init()

bool init ( )

Initializes an array NA.

◆ initWithArray()

bool initWithArray ( CCArray otherArray)

Initializes an array with an existing array NA.

◆ initWithCapacity()

bool initWithCapacity ( unsigned int  capacity)

Initializes an array with capacity NA.

◆ initWithObject()

bool initWithObject ( CCObject pObject)

Initializes an array with one object NA.

◆ initWithObjects()

bool initWithObjects ( CCObject pObject,
  ... 
)

Initializes an array with some objects NA.

◆ insertObject()

void insertObject ( CCObject object,
unsigned int  index 
)

Insert a certain object at a certain index.

◆ isEqualToArray()

bool isEqualToArray ( CCArray pOtherArray)
Since
1.1

◆ lastObject()

CCObject * lastObject ( )

Returns last element.

◆ objectAtIndex()

CCObject * objectAtIndex ( unsigned int  index)

Returns an element with a certain index.

◆ randomObject()

CCObject * randomObject ( )

Returns a random element.

◆ reduceMemoryFootprint()

void reduceMemoryFootprint ( )

◆ removeAllObjects()

void removeAllObjects ( )

Remove all objects.

◆ removeLastObject()

void removeLastObject ( bool  bReleaseObj = true)

Remove last object.

◆ removeObject()

void removeObject ( CCObject object,
bool  bReleaseObj = true 
)

Remove a certain object.

◆ removeObjectAtIndex()

void removeObjectAtIndex ( unsigned int  index,
bool  bReleaseObj = true 
)

Remove an element with a certain index.

◆ removeObjectsInArray()

void removeObjectsInArray ( CCArray otherArray)

Remove all elements.

◆ replaceObjectAtIndex()

void replaceObjectAtIndex ( unsigned int  uIndex,
CCObject pObject,
bool  bReleaseObject = true 
)

Replace object at index with another object.

◆ reverseObjects()

void reverseObjects ( )

Revers the array.

Member Data Documentation

◆ data

ccArray* data

The documentation for this class was generated from the following file: