cocos2d-x  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
__Array Class Reference

#include <CCArray.h>

Inheritance diagram for __Array:
Ref Clonable

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...
 
RefgetObjectAtIndex (ssize_t index)
 Returns an element with a certain index NA NA. More...
 
RefobjectAtIndex (ssize_t index)
 
RefgetLastObject ()
 Returns the last element of the array NA. More...
 
ReflastObject ()
 NA More...
 
RefgetRandomObject ()
 Returns a random element NA NA. More...
 
RefrandomObject ()
 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 __Arrayclone () const
 NA NA More...
 
Ref ** begin ()
 NA NA More...
 
Ref ** end ()
 NA NA More...
 
 __Array ()
 NA NA More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 NA NA More...
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()
 NA NA More...
 
Refcopy () const
 returns a copy of the Ref. More...
 

Static Public Member Functions

static __Arraycreate ()
 Creates an empty array. More...
 
static __Arraycreate (Ref *object,...) CC_REQUIRES_NULL_TERMINATION
 Create an array with objects NA. More...
 
static __ArraycreateWithObject (Ref *object)
 Create an array with one object NA. More...
 
static __ArraycreateWithCapacity (ssize_t capacity)
 Create an array with a default capacity NA. More...
 
static __ArraycreateWithArray (__Array *otherArray)
 Create an array with from an existing array NA. More...
 
static __ArraycreateWithContentsOfFile (const std::string &pFileName)
 Generate a Array pointer by file. More...
 
static __ArraycreateWithContentsOfFileThreadSafe (const std::string &pFileName)
 

Public Attributes

ccArray * data
 

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 

Constructor & Destructor Documentation

~__Array ( )

NA NA

__Array ( )

NA NA

Member Function Documentation

virtual void acceptVisitor ( DataVisitor visitor)
virtual
void addObject ( Ref object)

Add a certain object NA.

void addObjectsFromArray ( __Array otherArray)

NA

Add all elements of an existing array NA

Ref** begin ( )
inline

NA NA

ssize_t capacity ( ) const
inline

Returns capacity of the array NA.

virtual __Array* clone ( ) const
virtual

NA NA

Implements Clonable.

bool containsObject ( Ref object) const

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

NA

ssize_t count ( ) const
inline

Returns element count of the array NA.

static __Array* create ( )
static

Creates an empty array.

Default capacity is 10 NA NA

static __Array* create ( Ref object,
  ... 
)
static

Create an array with objects NA.

static __Array* createWithArray ( __Array otherArray)
static

Create an array with from an existing array NA.

static __Array* createWithCapacity ( ssize_t  capacity)
static

Create an array with a default capacity NA.

static __Array* createWithContentsOfFile ( const std::string &  pFileName)
static

Generate a Array pointer by file.

Parameters
pFileNameThe file name of *.plist file
Returns
The Array pointer generated from the file NA
static __Array* createWithContentsOfFileThreadSafe ( const std::string &  pFileName)
static
static __Array* createWithObject ( Ref object)
static

Create an array with one object NA.

Ref** end ( )
inline

NA NA

void exchangeObject ( Ref object1,
Ref object2 
)

Swap two elements NA.

void exchangeObjectAtIndex ( ssize_t  index1,
ssize_t  index2 
)

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.

void fastSetObject ( Ref object,
ssize_t  index 
)
inline

sets a certain object at a certain index without retaining.

Use it with caution NA NA

ssize_t getIndexOfObject ( Ref object) const

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

Ref* getLastObject ( )
inline

Returns the last element of the array NA.

Ref* getObjectAtIndex ( ssize_t  index)
inline

Returns an element with a certain index NA NA.

Ref* getRandomObject ( )

Returns a random element NA NA.

ssize_t indexOfObject ( Ref object) const
inline

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.

void insertObject ( Ref object,
ssize_t  index 
)

Insert a certain object at a certain index NA.

bool isEqualToArray ( __Array otherArray)
Since
1.1 NA
Ref* lastObject ( )
inline

NA

Ref* objectAtIndex ( ssize_t  index)
inline
Ref* randomObject ( )
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.

void replaceObjectAtIndex ( ssize_t  index,
Ref object,
bool  releaseObject = true 
)

Replace object at index with another object.

NA

void reverseObjects ( )

Revers the array NA.

void setObject ( Ref object,
ssize_t  index 
)

sets a certain object at a certain index NA NA

void swap ( ssize_t  indexOne,
ssize_t  indexTwo 
)
inline

NA NA

Member Data Documentation

ccArray* data

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