SwatDB
Public Member Functions | Private Attributes | List of all members
HeapPageScanner Class Reference

#include <heappagescanner.h>

Collaboration diagram for HeapPageScanner:
Collaboration graph
[legend]

Public Member Functions

 HeapPageScanner (HeapPage *page)
 Constructor. More...
 
 ~HeapPageScanner ()
 Destructor.
 
SlotId getNext ()
 Returns SlotId of the next valid slot. More...
 
void reset (HeapPage *page)
 Resets the scanner, so it could be used for another Page. More...
 

Private Attributes

HeapPagepage
 Page to be scanned. The Page is pinned outside the scope of the scanner.
 
SlotId cur_slot
 Current slot being scanned.
 

Detailed Description

Scanner class for scanning HeapPage.

Constructor & Destructor Documentation

◆ HeapPageScanner()

HeapPageScanner::HeapPageScanner ( HeapPage page)

Constructor.

Precondition
Valid HeapPage* is provided as input. The given Page is pinned.
Postcondition
HeapPageScanner is constructed with initialized data members. page is still pinned.
Parameters
pageHeapPage object to be scanned.

Member Function Documentation

◆ getNext()

SlotId HeapPageScanner::getNext ( )

Returns SlotId of the next valid slot.

Precondition
page is pinned.
Postcondition
SlotId of the next valid slot is returned. Current slot field is set to the next SlotId. Current slot field may be incremented by more than one. If the scanner reaches the end of the slot directory, INVALID_SLOT_ID is returned. page is still pinned.
Returns
Next valid SlotId. INVALID_SLOT_ID if the end of the Page is reached. page is still pinned.

◆ reset()

void HeapPageScanner::reset ( HeapPage page)

Resets the scanner, so it could be used for another Page.

Precondition
The new Page is pinned.
Postcondition
page is set to the provided HeapPage* and current slot is reset to 0. The new Page is still pinned.
Parameters
pageHeapPage object to reset to.

The documentation for this class was generated from the following file: