FBArrayTemplate Class Template Reference

#include <fbarray.h>
FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate FBArrayTemplate
Inheritance diagram for FBArrayTemplate:
Inheritance graph
[legend]

List of all members.


Detailed Description

template<class Type>
class FBArrayTemplate< Type >

Template class to contain an array of items.

Definition at line 75 of file fbarray.h.


Public Member Functions

  FBArrayTemplate (int pItemPerBlock=10)
  Constructor.
  ~FBArrayTemplate ()
  Destructor.
int  InsertAt (int pIndex, Type pItem)
  Insert pItem at pIndex.
void  RemoveAt (int pIndex)
  Remove item at pIndex.
void  RemoveLast ()
  Remove the last item in the array.
bool  Remove (Type &pItem)
  Remove pItem from the array.
bool  RemoveIt (Type pItem)
  Remove pItem from the array.
void  Clear ()
  Empty the array of all items.
Type &  operator[] (int pIndex) const
  [] operator overload.
void  SetAt (int pIndex, Type pItem)
  Set item at pIndex to pItem.
void  SetLast (Type pItem)
  Set the last item of the array.
int  GetCount () const
  Get the number of items in the array.
void  SetCount (int pCount)
  Set the number of items in the array.
Type  GetAt (int pIndex)
  Get item at pIndex.
Type  GetLast ()
  Get last item of the array.
int  Find (Type pItem)
  Find the index of pItem in the array.
int  Add (Type pItem)
  Add an item to the end of the array.
Type *  GetArray ()
  Get a pointer to the array of items.
FBArrayTemplate< Type > &  operator= (const FBArrayTemplate< Type > &pArrayTemplate)
  Copy array of pointers without copying the associated objects.

Constructor & Destructor Documentation

FBArrayTemplate ( int  pItemPerBlock = 10  )  [inline]

Constructor.

Parameters:
pItemPerBlock  Number of items per array block (default is 10).

Definition at line 81 of file fbarray.h.

~FBArrayTemplate (  )  [inline]

Destructor.

Definition at line 90 of file fbarray.h.


Member Function Documentation

int InsertAt ( int  pIndex,
Type  pItem  
) [inline]

Insert pItem at pIndex.

Parameters:
pIndex  Index to insert at.
pItem  Item to insert.
Returns:
Actual insertion index where pItem was inserted.

Definition at line 100 of file fbarray.h.

void RemoveAt ( int  pIndex  )  [inline]

Remove item at pIndex.

Parameters:
pIndex  Index to remove item from.

Definition at line 129 of file fbarray.h.

void RemoveLast (  )  [inline]

Remove the last item in the array.

Definition at line 141 of file fbarray.h.

bool Remove ( Type &  pItem  )  [inline]

Remove pItem from the array.

Parameters:
pItem  Item to remove.
Returns:
Operation was successful (true or false).

Definition at line 147 of file fbarray.h.

bool RemoveIt ( Type  pItem  )  [inline]

Remove pItem from the array.

Parameters:
pItem  Item to remove.
Returns:
Outcome of removal (true or false).

Definition at line 161 of file fbarray.h.

void Clear (  )  [inline]

Empty the array of all items.

Definition at line 172 of file fbarray.h.

Type& operator[] ( int  pIndex  )  const [inline]

[] operator overload.

Parameters:
pIndex  Index of item to access.
Returns:
Item corresponding to pIndex.

Definition at line 186 of file fbarray.h.

void SetAt ( int  pIndex,
Type  pItem  
) [inline]

Set item at pIndex to pItem.

Parameters:
pIndex  Index of item to set.
pItem  Item to copy into the array.

Definition at line 196 of file fbarray.h.

void SetLast ( Type  pItem  )  [inline]

Set the last item of the array.

Parameters:
pItem  Item to copy as the last item of the array
Warning:
Will write over last item in the array!

Definition at line 206 of file fbarray.h.

int GetCount (  )  const [inline]

Get the number of items in the array.

Returns:
Number of items in the array.

Definition at line 214 of file fbarray.h.

Referenced by FBArrayTemplate< HFBModelMarkerOptical >::operator=().

void SetCount ( int  pCount  )  [inline]

Set the number of items in the array.

Definition at line 221 of file fbarray.h.

Type GetAt ( int  pIndex  )  [inline]

Get item at pIndex.

Parameters:
pIndex  Index of desired item.
Returns:
Item specified by pIndex.

Definition at line 252 of file fbarray.h.

Type GetLast (  )  [inline]

Get last item of the array.

Returns:
Last item of the array.

Definition at line 261 of file fbarray.h.

int Find ( Type  pItem  )  [inline]

Find the index of pItem in the array.

Parameters:
pItem  Item to look for in the array.
Returns:
Index number of element found. Returns -1 if pItem was not found.

Definition at line 270 of file fbarray.h.

int Add ( Type  pItem  )  [inline]

Add an item to the end of the array.

Parameters:
pItem  Item to insert into the array.
Returns:
Index where pItem was inserted.

Definition at line 285 of file fbarray.h.

Type* GetArray (  )  [inline]

Get a pointer to the array of items.

Returns:
Pointer to the array of items.
Warning:
Gives direct access to the array pointer!

Definition at line 294 of file fbarray.h.

FBArrayTemplate<Type>& operator= ( const FBArrayTemplate< Type > &  pArrayTemplate  )  [inline]

Copy array of pointers without copying the associated objects.

Parameters:
pArrayTemplate  Array to copy from.
Returns:
Pointer to the this class.

Definition at line 303 of file fbarray.h.


Please send us your comments about this page.