Class: TMemoryHeapIterator

Declaration: MemoryHeap.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TStandardMemoryHeapIterator

Purpose:

TMemoryHeapIterator is a class that can be used to iterate over either the allocated or free blocks in a TMemoryHeap. The heap iterator traverses the memory heap and returns the address of each distinct allocated or free block. A memory heap is an unordered collection of allocated and free blocks.

Instantiation:

Always allocate on the heap.

Deriving Classes:

TMemoryHeapIterator can be used to derive Iterators for special-purpose heap classes that are derived from TMemoryHeap.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TMemoryHeapIterator::TMemoryHeapIterator

TMemoryHeapIterator (const TMemoryHeap * memoryHeap)

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: TMemoryHeapIterator::~TMemoryHeapIterator

virtual ~ TMemoryHeapIterator ()

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: TMemoryHeapIterator::First

virtual TMemorySurrogate First (EHeapBlockType =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 will return the next block of the specified type. Blocks returned can be free, 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:

A TMemorySurrogate that describes the first block of the type specified.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

The iterator returns blocks in an arbitrary order, without regard to the block's address or size.

Member Function: TMemoryHeapIterator::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 exceptions 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.