SwatDB
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
HashBucketPageScanner Class Reference

#include <hashbucketpagescanner.h>

Collaboration diagram for HashBucketPageScanner:
Collaboration graph
[legend]

Public Member Functions

 HashBucketPageScanner ()
 Default Constructor.
 
 HashBucketPageScanner (HashBucketPage *page)
 Constructor.
 
 ~HashBucketPageScanner ()
 Destructor.
 
std::pair< SlotId, SlotInfogetNext ()
 Returns pair of SlotId and SlotInfo of the next valid slot.
 
void reset (HashBucketPage *page)
 Resets the scanner, so it could be used for another Page.
 

Private Attributes

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

Detailed Description

Scanner fo HashBucketPage. Used internally in the HashIndexFile.

Constructor & Destructor Documentation

◆ HashBucketPageScanner()

HashBucketPageScanner::HashBucketPageScanner ( HashBucketPage page)

Constructor.

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

Member Function Documentation

◆ getNext()

std::pair< SlotId, SlotInfo > HashBucketPageScanner::getNext ( )

Returns pair of SlotId and SlotInfo of the next valid slot.

Precondition
Page is pinned.
Postcondition
SlotId and SlotInfo 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 and SlotInfo. INVALID_SLOT_ID if the end of the Page is reached. page is still pinned.

◆ reset()

void HashBucketPageScanner::reset ( HashBucketPage 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 HashBucketPage* and current slot is reset to 0. The new Page is still pinned.
Parameters
pageHashBucketPage object to reset to.

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