Zero  0.1.0
Private Attributes | List of all members
generic_page Class Reference

A generic page view: any Zero page can be viewed as being of this type but it only exposes fields shared by all Zero pages. To "downcast" and access page-type–specific fields, pass a pointer to one of these to one of the page handle classes' (e.g., btree_page_h) constructors. More...

#include <generic_page.h>

Inheritance diagram for generic_page:
generic_page_header

Private Attributes

char subclass_specific [page_sz - sizeof(generic_page_header)]
 

Additional Inherited Members

- Public Member Functions inherited from generic_page_header
uint32_t calculate_checksum () const
 Calculate the correct value of checksum for this page. More...
 
- Public Attributes inherited from generic_page_header
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 inherited from generic_page_header
static const size_t page_sz = SM_PAGESIZE
 Size of all Zero pages. More...
 
- Protected Attributes inherited from generic_page_header
uint16_t page_flags
 Page flags (an OR of page_flag_t's) More...
 
uint64_t reserved
 Reserved for subclass usage. More...
 

Detailed Description

A generic page view: any Zero page can be viewed as being of this type but it only exposes fields shared by all Zero pages. To "downcast" and access page-type–specific fields, pass a pointer to one of these to one of the page handle classes' (e.g., btree_page_h) constructors.

All zero pages have the same size and initial headers (generic_page_header's). Each specific page type has an associated data type that is a (indirect) subclass of generic_page_header as well as an associated handle class. For example, B-tree pages have associated page class btree_page and handle class btree_page_h. Casting between page types is done by the handle classes after verifying the cast is safe according to the page tag. No other code should perform such casts.

The corresponding handle class for this page type is generic_page_h.

Member Data Documentation

§ subclass_specific

char generic_page::subclass_specific[page_sz - sizeof(generic_page_header)]
private

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