LVariableArray is a PowerPlant class that is similar to LArray, but allows you to store data of differing element sizes.
Methods :
The methods in this class are:
Data Members:
The data members in this class are:
Operation:
This class overrides several member functions of LArray to implement data storage and retrieval in a situation where array elements vary in size.
The public interface and usage is mostly identical to that of LArray.
Source files:
Ancestors:
See Also:
Purpose:
The constructor creates objects from the passed-in parameters.
Access:
Prototype:
LVariableArray( LComparator *inComparator,
Boolean inKeepSorted );
LVariableArray( Handle inItemsHandle,Parameters:
ArrayOffsetH inOffsetsHandle,
LComparator *inComparator,
Boolean inIsSorted,
Boolean inKeepSorted );
The parameters for these constructors are:
Purpose:
The destructor destroys the object.
Access:
Prototype:
virtual ~LVariableArray();
Purpose:
Adjust the size of the Handle used to store array items. This is an override of AdjustAllocation() in LArray.
Purpose:
Called internally when the number of bytes used by Items in the array changes. This is an override of AdjustStorage() in LArray.
Purpose:
Assign the same value to items starting at the specified index. This is an override of AdjustStorage() in LArray.
Purpose:
This method returns the offset into the array for a given item.
Access:
Prototype:
UInt32 GetItemOffset( ArrayIndexT inAtIndex);Parameters:
This method has the following parameter:
Return:
Purpose:
Return a pointer to the start of an item's data within the internal storage Handle. This method performs no error checking on the index.
Access:
Prototype:
virtual void* GetItemPtr(ArrayIndexT inIndex) const;Parameters:
This method has the following parameter:
Return:
The pointer to the array item.
Remarks:
WARNING: Unless you have called Lock(), the returned pointer points to data within a relocatable Handle block.
Purpose:
Return the size in bytes of an item in the array.
Access:
Prototype:
virtual UInt32 GetItemSize(Parameters:
ArrayIndexT inIndex) const;
This method has the following parameter:
Return:
UInt32 containing the size in bytes of an item.
Purpose:
Return Handle used to store offsets to the data for array items. This is an accessor method for mItemOffsetsH.
Access:
Prototype:
Handle GetOffsetsHandle() const;Parameters:
Return:
The handle used to store offsets (mItemOffsetsH).
Remarks:
Purpose:
Return the size in bytes of the items from inStartIndex to inEndIndex, inclusive. This is an override of GrabItemRangeSize() in LArray.
Purpose:
Return the size in bytes of the specified item. This method is
the same as GetItemSize() except it doesn't validate inIndex.This is an override of GrabItemSize() in LArray.
Purpose:
Called internally to change the size of the storage used. This is an override of InternalAdjustAllocation() in LArray.
Purpose:
Set the item at inDestIndex to a copy of the item at inSourceIndex. This is an override of InternalCopyItem() in LArray.
Purpose:
Store data for the item at the specified index. This is an override of PokeItem() in LArray.
Purpose:
Moves items within the Handle used for internal storage. This is an override of ShiftItems() in LArray.
Purpose:
Sort items in the array. This is an override of Sort() in LArray.
Purpose:
Store values within the internal storage Handle. Items all have the same value, and space must already have been allocated for them. This is an override of StoreNewItems() in LArray.
Purpose:
This stores the handle for the offsets.
Access:
Prototype:
ArrayOffsetH mItemOffsetsH;
Purpose:
This stores the items allocated information.
Access:
Prototype:
UInt32 mItemsAllocated;