Zero  0.1.0
Static Public Member Functions | Static Public Attributes | Static Private Attributes | Friends | List of all members
zero::buffer_pool::SimpleSwizzling Class Reference

TODO. More...

#include <buffer_pool_pointer_swizzling.hpp>

Static Public Member Functions

static bool isSwizzledPointer (const PageID pid) noexcept
 Checks whether a page ID is a swizzled buffer index. More...
 
static PageID makeSwizzledPointer (const bf_idx index) noexcept
 Transforms a buffer pool index into a swizzled page ID. More...
 
static bf_idx makeBufferIndex (const PageID pid) noexcept
 Transforms a swizzled page ID to a buffer pool index. More...
 
static void debugDumpPointer (std::ostream &o, PageID pid)
 Dumps the given page ID to an output stream. More...
 

Static Public Attributes

static constexpr bool usesPointerSwizzling = true
 TODO. More...
 

Static Private Attributes

static constexpr PageID swizzledPIDBit = 0b10000000000000000000000000000000
 Bit which is set in swizzled pointers to mark those. More...
 

Friends

class BufferPool
 

Detailed Description

TODO.

TODO

Member Function Documentation

§ debugDumpPointer()

zero::buffer_pool::SimpleSwizzling::debugDumpPointer ( std::ostream &  o,
PageID  pid 
)
static

Dumps the given page ID to an output stream.

Dumps the given possibly swizzled page ID with additional information about swizzling etc. to an output stream.

Precondition
The stream manipulators of o are set as expected.
Parameters
oThe output stream to which the pointer is printed.
pidThe pointer (page ID) to print.

§ isSwizzledPointer()

zero::buffer_pool::SimpleSwizzling::isSwizzledPointer ( const PageID  pid)
inlinestaticnoexcept

Checks whether a page ID is a swizzled buffer index.

Whether the given page ID is actually swizzled and therefore a buffer pool index marked as such.

Parameters
pidA page ID that might be swizzled.
Returns
Whether pid is a swizzled pointer.

§ makeBufferIndex()

zero::buffer_pool::SimpleSwizzling::makeBufferIndex ( const PageID  pid)
inlinestaticnoexcept

Transforms a swizzled page ID to a buffer pool index.

Transforms the given swizzled page ID into a buffer pool index by unsetting the flag swizzledPIDBit that marked the page ID as a swizzled pointer.

Parameters
pidA swizzled page ID
Returns
The buffer pool index where the page specified in pid can be found.

§ makeSwizzledPointer()

zero::buffer_pool::SimpleSwizzling::makeSwizzledPointer ( const bf_idx  index)
inlinestaticnoexcept

Transforms a buffer pool index into a swizzled page ID.

Transforms the given buffer pool index into a swizzled page ID by setting the flag swizzledPIDBit to mark it as a swizzled pointer.

Parameters
indexA buffer pool index
Returns
The swizzled page ID to be used inside the parent page

Friends And Related Function Documentation

§ BufferPool

friend class BufferPool
friend

Member Data Documentation

§ swizzledPIDBit

zero::buffer_pool::SimpleSwizzling::swizzledPIDBit = 0b10000000000000000000000000000000
staticprivate

Bit which is set in swizzled pointers to mark those.

§ usesPointerSwizzling

zero::buffer_pool::SimpleSwizzling::usesPointerSwizzling = true
static

TODO.


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