Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

nsVoidArray Class Reference

A basic zero-based array of void*'s that manages its own memory. More...

#include <nsVoidArray.h>

Inheritance diagram for nsVoidArray:
Collaboration diagram for nsVoidArray:

List of all members.

Classes

struct  Impl

Public Member Functions

 nsVoidArray ()
 nsVoidArray (PRInt32 aCount)
 ~nsVoidArray ()
nsVoidArrayoperator= (const nsVoidArray &other)
PRInt32 Count () const
PRInt32 GetArraySize () const
void * FastElementAt (PRInt32 aIndex) const
void * ElementAt (PRInt32 aIndex) const
void * SafeElementAt (PRInt32 aIndex) const
void * operator[] (PRInt32 aIndex) const
PRInt32 IndexOf (void *aPossibleElement) const
PRBool InsertElementAt (void *aElement, PRInt32 aIndex)
PRBool InsertElementsAt (const nsVoidArray &other, PRInt32 aIndex)
PRBool ReplaceElementAt (void *aElement, PRInt32 aIndex)
PRBool MoveElement (PRInt32 aFrom, PRInt32 aTo)
PRBool AppendElement (void *aElement)
PRBool AppendElements (nsVoidArray &aElements)
PRBool RemoveElement (void *aElement)
PRBool RemoveElementsAt (PRInt32 aIndex, PRInt32 aCount)
PRBool RemoveElementAt (PRInt32 aIndex)
void Clear ()
PRBool SizeTo (PRInt32 aMin)
void Compact ()
void Sort (nsVoidArrayComparatorFunc aFunc, void *aData)
PRBool EnumerateForwards (nsVoidArrayEnumFunc aFunc, void *aData)
PRBool EnumerateBackwards (nsVoidArrayEnumFunc aFunc, void *aData)

Protected Types

enum  { kArrayOwnerMask = 1 << 31, kArrayHasAutoBufferMask = 1 << 30, kArraySizeMask = ~(kArrayOwnerMask | kArrayHasAutoBufferMask) }
enum  { kAutoBufSize = 8 }

Protected Member Functions

PRBool GrowArrayBy (PRInt32 aGrowBy)
void SetArray (Impl *newImpl, PRInt32 aSize, PRInt32 aCount, PRBool aOwner, PRBool aHasAuto)
PRBool IsArrayOwner () const
PRBool HasAutoBuffer () const

Protected Attributes

ImplmImpl

Detailed Description

A basic zero-based array of void*'s that manages its own memory.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
kArrayOwnerMask 
kArrayHasAutoBufferMask 
kArraySizeMask 
anonymous enum [protected]
Enumerator:
kAutoBufSize 

Constructor & Destructor Documentation

nsVoidArray::nsVoidArray (  ) 
nsVoidArray::nsVoidArray ( PRInt32  aCount  ) 
nsVoidArray::~nsVoidArray (  ) 

Member Function Documentation

PRBool nsVoidArray::AppendElement ( void *  aElement  )  [inline]

Reimplemented in nsSmallVoidArray.

PRBool nsVoidArray::AppendElements ( nsVoidArray aElements  )  [inline]

Reimplemented in nsSmallVoidArray.

void nsVoidArray::Clear (  ) 
void nsVoidArray::Compact (  ) 
PRInt32 nsVoidArray::Count ( void   )  const [inline]
void* nsVoidArray::ElementAt ( PRInt32  aIndex  )  const [inline]

Reimplemented in nsSmallVoidArray.

PRBool nsVoidArray::EnumerateBackwards ( nsVoidArrayEnumFunc  aFunc,
void *  aData 
)
PRBool nsVoidArray::EnumerateForwards ( nsVoidArrayEnumFunc  aFunc,
void *  aData 
)
void* nsVoidArray::FastElementAt ( PRInt32  aIndex  )  const [inline]

Reimplemented in nsSmallVoidArray.

PRInt32 nsVoidArray::GetArraySize (  )  const [inline]

Reimplemented in nsSmallVoidArray.

PRBool nsVoidArray::GrowArrayBy ( PRInt32  aGrowBy  )  [protected]
PRBool nsVoidArray::HasAutoBuffer (  )  const [inline, protected]
PRInt32 nsVoidArray::IndexOf ( void *  aPossibleElement  )  const

Reimplemented in nsSmallVoidArray.

PRBool nsVoidArray::InsertElementAt ( void *  aElement,
PRInt32  aIndex 
)

Reimplemented in nsSmallVoidArray.

PRBool nsVoidArray::InsertElementsAt ( const nsVoidArray other,
PRInt32  aIndex 
)

Reimplemented in nsSmallVoidArray.

PRBool nsVoidArray::IsArrayOwner (  )  const [inline, protected]
PRBool nsVoidArray::MoveElement ( PRInt32  aFrom,
PRInt32  aTo 
)

Reimplemented in nsSmallVoidArray.

nsVoidArray& nsVoidArray::operator= ( const nsVoidArray other  ) 
void* nsVoidArray::operator[] ( PRInt32  aIndex  )  const [inline]
PRBool nsVoidArray::RemoveElement ( void *  aElement  ) 

Reimplemented in nsSmallVoidArray.

PRBool nsVoidArray::RemoveElementAt ( PRInt32  aIndex  )  [inline]

Reimplemented in nsSmallVoidArray.

PRBool nsVoidArray::RemoveElementsAt ( PRInt32  aIndex,
PRInt32  aCount 
)

Reimplemented in nsSmallVoidArray.

PRBool nsVoidArray::ReplaceElementAt ( void *  aElement,
PRInt32  aIndex 
)

Reimplemented in nsSmallVoidArray.

void* nsVoidArray::SafeElementAt ( PRInt32  aIndex  )  const [inline]

Reimplemented in nsSmallVoidArray.

void nsVoidArray::SetArray ( Impl newImpl,
PRInt32  aSize,
PRInt32  aCount,
PRBool  aOwner,
PRBool  aHasAuto 
) [protected]
PRBool nsVoidArray::SizeTo ( PRInt32  aMin  ) 

Reimplemented in nsSmallVoidArray.

void nsVoidArray::Sort ( nsVoidArrayComparatorFunc  aFunc,
void *  aData 
)

Member Data Documentation

Impl* nsVoidArray::mImpl [protected]

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