#include <winstl/memory/heapwalk_sequence.hpp>
The following code illustrates the use of the class to enumerate all currently allocated blocks in the given heap:
HANDLE hHeap = . . . // Handle to an existing heap winstl::heapwalk_sequence blocks(hHeap); winstl::heapwalk_sequence::const_iterator b = blocks.begin(); winstl::heapwalk_sequence::const_iterator e = blocks.end(); for(; b != e; ++b) { printf(" Block of size %lu at %p\n", (*b).cbData, (*b).lpData); }
If you do not specify a heap handle, the sequence uses the process heap, as shown in the following code:
winstl::heapwalk_sequence blocks; // Uses process heap winstl::heapwalk_sequence::const_iterator b = blocks.begin(); winstl::heapwalk_sequence::const_iterator e = blocks.end(); for(; b != e; ++b) { printf(" Block of size %lu at %p\n", (*b).cbData, (*b).lpData); }
Member Types | |
typedef heapwalk_sequence | class_type |
The class. | |
typedef entry_type const & | value_type |
The value type. | |
typedef heapwalk_sequence_const_iterator | const_iterator |
The non-mutating (const) iterator type. | |
typedef entry_type const & | const_reference |
The non-mutating (const) reference type. | |
Public Member Functions | |
Construction | |
heapwalk_sequence () | |
Creates an instance that walks the default process heap. | |
heapwalk_sequence (HANDLE hHeap) | |
Creates an instance that walks the given heap. | |
~heapwalk_sequence () throw () | |
Destructor. | |
Iteration | |
const_iterator | begin () const |
Begins the iteration. | |
const_iterator | end () const |
Ends the iteration. |
typedef heapwalk_sequence class_type |
The class.
typedef entry_type const& value_type |
The value type.
The non-mutating (const) iterator type.
typedef entry_type const& const_reference |
The non-mutating (const) reference type.
Creates an instance that walks the default process heap.
heapwalk_sequence | ( | HANDLE | hHeap | ) | [explicit] |
Creates an instance that walks the given heap.
~heapwalk_sequence | ( | ) | throw () |
Destructor.
const_iterator begin | ( | ) | const |
Begins the iteration.
const_iterator end | ( | ) | const |
Ends the iteration.