No need to lock contents as uses C++ arrays.
Doesn't require mutable keyword, unlike PP version because stashes pointer to iterator head at top of mItems.
|
Public Types |
| enum | { index_Bad = 0,
index_First = 1,
index_Last = 0x7FFFFFFF
} |
Public Methods |
| | LArray (Uint32 inItemSize=sizeof(long), Uint16 expandBySlots=4) |
| | Always alloc so have some leading space in dynamic alloc for iterator head.
|
| | LArray (UInt32 inItemSize, LComparator *inComparator, Boolean inKeepSorted) |
| | LArray (UInt32 inItemCount, UInt32 inItemSize, LComparator *inComparator, Boolean inKeepSorted) |
| | LArray (const LArray &) |
| LArray & | operator= (const LArray &) |
| virtual | ~LArray () |
| bool | ValidIndex (ArrayIndexT &ioIndex) const |
| | Test an index, taking count of special value index_Last.
|
| virtual void | Remove (const void *iinItem, UInt32 inItemSize=0) |
| | Remove an item without knowing location.
|
| void | Lock () const |
| | do nothing as don''t have Handle that needs locking
|
| void | Unlock () const |
| | do nothing as don''t have Handle that needs locking
|
| bool | IsLocked () const |
| | do nothing as don''t have Handle that needs locking
|
| virtual UInt32 | GrabItemSize (ArrayIndexT inIndex) const |
| | Virtual base always returns fixed item size.
|
| Uint32 | GetCount () const |
| virtual Uint32 | GetItemSize () const |
| virtual void * | GetItemPtr (ArrayIndexT inAtIndex) const |
| | Returns a pointer to the start of an Items data within the internal storage.
|
| virtual ArrayIndexT | AddItem (const void *inItem, Uint32 inItemSize=0) |
| virtual Boolean | FetchItemAt (ArrayIndexT, void *outItem) const |
| virtual ArrayIndexT | FetchIndexOf (const void *iinItem, UInt32 iinItemSize=0) const |
| | Find the index of the specified item using best search possible.
|
| virtual ArrayIndexT | InsertItemsAt (Uint32 inCount, ArrayIndexT inAtIndex, const void *inItem, Uint32 inItemSize=0) |
| virtual void | RemoveItemsAt (Uint32 inCount, ArrayIndexT inAtIndex) |
Protected Methods |
| void | DestroyArray () |
| | Cleanup - is aware of the implementation stashing iterator head in mAllocItems.
|
| void | ExpandToInclude (ArrayIndexT indexToCover) |
|
| void | AttachIterator (LArrayIterator *inIterator) const |
| | Insert the given iterator into our list.
|
| void | DetachIterator (LArrayIterator *inIterator) const |
| | Go along the linked list of iterators and unlink the specified one.
|
| void | ItemsInserted (UInt32 inCount, ArrayIndexT inAtIndex) |
| | Tell any iterators we have inserted items.
|
| void | ItemsRemoved (UInt32 inCount, ArrayIndexT inAtIndex) |
| | Tell any iterators we have removed items.
|
| LArrayIterator *& | iteratorListHead () const |
|
| ArrayIndexT | LinearSearch (const void *inItem, UInt32 inItemSize) const |
| | Search from beginning of array using user specified mComparator.
|
Protected Attributes |
| LComparator * | mComparator |
| bool | mOwnsComparator |
| Uint32 | mItemSize |
| Uint32 | mItemCount |
| char * | mItems |
| Uint32 | mNumSlots |
| | ref to offset pointer within mAllocItems
|
| Uint16 | mExpansionChunk |
Friends |
| class | LArrayIterator |