Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

p2mMessageReMap Class Reference

Inheritance diagram for p2mMessageReMap:

Inheritance graph
[legend]
Collaboration diagram for p2mMessageReMap:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { index_Bad = 0, index_First = 1, index_Last = 0x7FFFFFFF }

Public Methods

 p2mMessageReMap ()
void append (MessageT inMessage, short inWindowsMsg)
MessageT getRemap (short inWindowsMsg) const
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)
Iterator Support
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
Searching
ArrayIndexT LinearSearch (const void *inItem, UInt32 inItemSize) const
 Search from beginning of array using user specified mComparator.


Protected Attributes

LComparatormComparator
bool mOwnsComparator
Uint32 mItemSize
Uint32 mItemCount
char * mItems
Uint32 mNumSlots
 ref to offset pointer within mAllocItems

Uint16 mExpansionChunk

Member Enumeration Documentation

anonymous enum [inherited]
 

Enumeration values:
index_Bad 
index_First 
index_Last 


Constructor & Destructor Documentation

p2mMessageReMap::p2mMessageReMap  
 


Member Function Documentation

ArrayIndexT LArray::AddItem const void *    inItem,
Uint32    inItemSize = 0
[virtual, inherited]
 

void p2mMessageReMap::append MessageT    inMessage,
short    inWindowsMsg
 

void LArray::AttachIterator LArrayIterator   inIterator const [protected, inherited]
 

Insert the given iterator into our list.

void LArray::DestroyArray   [protected, inherited]
 

Cleanup - is aware of the implementation stashing iterator head in mAllocItems.

void LArray::DetachIterator LArrayIterator   inIterator const [protected, inherited]
 

Go along the linked list of iterators and unlink the specified one.

void LArray::ExpandToInclude ArrayIndexT    indexToCover [protected, inherited]
 

ArrayIndexT LArray::FetchIndexOf const void *    inItem,
UInt32    inItemSize = 0
const [virtual, inherited]
 

Find the index of the specified item using best search possible.

Parameters:
inItemSize  allowed to be zero to indicate default to standard size
Returns :
index_Bad if no items or one-based index otherwise
Todo:
call BinarySearch when sorting implemented

Boolean LArray::FetchItemAt ArrayIndexT   ,
void *    outItem
const [virtual, inherited]
 

Uint32 LArray::GetCount   const [inline, inherited]
 

void * LArray::GetItemPtr ArrayIndexT    inAtIndex const [virtual, inherited]
 

Returns a pointer to the start of an Items data within the internal storage.

Warning:
This routine performs no bounds checking. If index is not valid, routine may crash or return a pointer to arbitrary memory.
Warning:
For sorted Arrays, your updates may cause data to be out of order. If your changes alter the sorting order, call InvalidateSort() so that the Array's internal flags correctly reflect the sorting state. Then call Sort() afterwards if you still want the Array to be sorted.

virtual Uint32 LArray::GetItemSize   const [inline, virtual, inherited]
 

MessageT p2mMessageReMap::getRemap short    inWindowsMsg const
 

UInt32 LArray::GrabItemSize ArrayIndexT    inIndex const [inline, virtual, inherited]
 

Virtual base always returns fixed item size.

Virtual is inlined because much use of LArray is for local vars so compiler will still be able to use inline.

ArrayIndexT LArray::InsertItemsAt Uint32    inCount,
ArrayIndexT    inAtIndex,
const void *    inItem,
Uint32    inItemSize = 0
[virtual, inherited]
 

bool LArray::IsLocked   const [inline, inherited]
 

do nothing as don''t have Handle that needs locking

void LArray::ItemsInserted UInt32    inCount,
ArrayIndexT    inAtIndex
[protected, inherited]
 

Tell any iterators we have inserted items.

void LArray::ItemsRemoved UInt32    inCount,
ArrayIndexT    inAtIndex
[protected, inherited]
 

Tell any iterators we have removed items.

LArrayIterator *& LArray::iteratorListHead   const [inline, protected, inherited]
 

ArrayIndexT LArray::LinearSearch const void *    inItem,
UInt32    inItemSize
const [protected, inherited]
 

Search from beginning of array using user specified mComparator.

Uses equality tests only as assumes array unsorted. Assumes array doesn't change in size whilst searching.

void LArray::Lock   const [inline, inherited]
 

do nothing as don''t have Handle that needs locking

void LArray::Remove const void *    inItem,
UInt32    inItemSize = 0
[virtual, inherited]
 

Remove an item without knowing location.

Relies on search of FetchIndexOf so governed by its performance.

void LArray::RemoveItemsAt Uint32    inCount,
ArrayIndexT    inAtIndex
[virtual, inherited]
 

void LArray::Unlock   const [inline, inherited]
 

do nothing as don''t have Handle that needs locking

bool LArray::ValidIndex ArrayIndexT   ioIndex const [inherited]
 

Test an index, taking count of special value index_Last.

Parameters:
ioIndex  specifies index to test or request flag index_Last and may be updated.
Returns :
true if input index in range or requested last index and have items (mItemCount>0)
Warning:
assumes LArrayIterator uses negative values for special meaning.


Member Data Documentation

LComparator* LArray::mComparator [protected, inherited]
 

Uint16 LArray::mExpansionChunk [protected, inherited]
 

Uint32 LArray::mItemCount [protected, inherited]
 

char* LArray::mItems [protected, inherited]
 

Uint32 LArray::mItemSize [protected, inherited]
 

Uint32 LArray::mNumSlots [protected, inherited]
 

ref to offset pointer within mAllocItems

bool LArray::mOwnsComparator [protected, inherited]
 


The documentation for this class was generated from the following file:
Generated on Mon Jul 22 18:21:51 2002 for PP2MFC by doxygen1.2.17