Class: TStandardMemoryHeapIterator

Declaration: StandardMemoryHeap.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TMemoryHeapIterator

Inherited By:

None.

Purpose:

TStandardMemoryHeapIterator is a class that can be used to iterate over either the allocated or free blocks in a TStandardMemoryHeap. The heap iterator traverses the memory heap and returns the address of each distinct allocated or free block.

Instantiation:

Always allocate on the heap.

Deriving Classes:

Do not derive any classes from TStandardMemoryHeapIterator.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Other Considerations:

A memory heap is an unordered collection of allocated and free blocks.

Member Function: TStandardMemoryHeapIterator::TStandardMemoryHeapIterator

TStandardMemoryHeapIterator (const TStandardMemoryHeap * whichHeap)

Interface Category:

API.

Purpose:

Constructs a heap iterator.

Calling Context:

Called by clients of TStandardMemoryHeap.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardMemoryHeapIterator::~TStandardMemoryHeapIterator

virtual ~ TStandardMemoryHeapIterator ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardMemoryHeapIterator::First

virtual TMemorySurrogate First (EHeapBlockType =TMemoryHeapIterator :: kAllocated)

Interface Category:

API.

Purpose:

Sets the type of blocks to be returned when iterating through the heap and returns a TMemorySurrogate for the first block. Subsequent calls to Next return the next block of the specified type. Blocks returned can be blocks that are free, blocks that are allocated, or both types of blocks.

Calling Context:

Called to set the type of blocks to be returned when iterating through the heap and return a TMemorySurrogate for the first block.

Parameters:

Return Value:

Returns a block.

Exceptions:

Throws TChunkyHeapCorrupted if the heap is corrupted. Other exceptions can be passed through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardMemoryHeapIterator::Next

virtual TMemorySurrogate Next ()

Interface Category:

API.

Purpose:

Returns a TMemorySurrogate for the next allocated or free block in the heap, depending upon the mode specified in a prior call to First.

Calling Context:

Called to return a TMemorySurrogate for the next block in the heap.

Parameters:

Return Value:

Returns a TMemorySurrogate for the next allocated or free block in the heap. A TMemorySurrogate with a NIL address is returned if there has not been a call to First or Next prior to the call to this member function or if the last block in the heap has already been returned.

Exceptions:

Throws no exceptions, passes all exception through.

Concurrency:

Multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.