Zero  0.1.0
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Friends | List of all members
generic_page_header Class Reference

Page headers shared by all Zero pages. More...

#include <generic_page.h>

Inheritance diagram for generic_page_header:
alloc_page btree_page_data generic_page stnode_page btree_page

Public Member Functions

uint32_t calculate_checksum () const
 Calculate the correct value of checksum for this page. More...
 

Public Attributes

uint32_t checksum
 Stored checksum of this page. More...
 
PageID pid
 ID of this page. More...
 
lsn_t lsn
 LSN (Log Sequence Number) of the last write to this page. More...
 
StoreID store
 ID of the store to which this page belongs (0 if none) More...
 
uint16_t tag
 Page type (a page_tag_t) More...
 

Static Public Attributes

static const size_t page_sz = SM_PAGESIZE
 Size of all Zero pages. More...
 

Protected Attributes

uint16_t page_flags
 Page flags (an OR of page_flag_t's) More...
 
uint64_t reserved
 Reserved for subclass usage. More...
 

Friends

class fixable_page_h
 
std::ostream & operator<< (std::ostream &, generic_page_header &)
 

Detailed Description

Page headers shared by all Zero pages.

All page data types (e.g., generic_page, alloc_page, btree_page, stnode_page) inherit (indirectly) from this class. This is a POD.

The checksum field is placed first to make the region of data

it covers continuous. The order of the other fields has been arranged to maximize packing into the fewest number of words possible.

Because this class contains an 8-byte aligned object (lsn_t),

it must be a multiple of eight bytes. The extra space not needed for all pages (field reserved) is reserved for subclass usage.

Some page types (alloc_page, stnode_page) do not currently

(9/2013) use the lsn, reserved, or page_flags fields.

Member Function Documentation

§ calculate_checksum()

uint32_t generic_page_header::calculate_checksum ( ) const

Calculate the correct value of checksum for this page.

Friends And Related Function Documentation

§ fixable_page_h

friend class fixable_page_h
friend

§ operator<<

std::ostream& operator<< ( std::ostream &  os,
generic_page_header p 
)
friend

Member Data Documentation

§ checksum

uint32_t generic_page_header::checksum
mutable

Stored checksum of this page.

Checksum is calculated from various parts of this page and updated just before this page is written out to permanent storage. It is checked each time this page is read in from the permanent storage.

§ lsn

lsn_t generic_page_header::lsn

LSN (Log Sequence Number) of the last write to this page.

§ page_flags

uint16_t generic_page_header::page_flags
protected

Page flags (an OR of page_flag_t's)

§ page_sz

const size_t generic_page_header::page_sz = SM_PAGESIZE
static

Size of all Zero pages.

§ pid

PageID generic_page_header::pid

ID of this page.

§ reserved

uint64_t generic_page_header::reserved
protected

Reserved for subclass usage.

§ store

StoreID generic_page_header::store

ID of the store to which this page belongs (0 if none)

§ tag

uint16_t generic_page_header::tag

Page type (a page_tag_t)


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