tinySQL  0.1
A self-contained database management system
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Page Class Reference

The storage details of each page in the memory. More...

#include <buffer_manager.h>

Public Member Functions

 Page ()
 Construct a new Page:: Page object. More...
 
void initialize ()
 初始化 More...
 
void setFileName (std::string file_name)
 
std::string getFileName () const
 
void setBlockId (int block_id)
 
int getBlockId () const
 
void setPinCount (int pin_count)
 
int getPinCount () const
 
void setDirty (bool dirty)
 
bool isDirty () const
 
void setAvaliable (bool avaliable)
 
bool getAvaliable () const
 
void setTime ()
 
long long getTime ()
 
char * getBuffer ()
 
std::string getPageStrId ()
 

Static Public Member Functions

static std::string generatePageStrId (const std::string &file_path, int b_id)
 

Public Attributes

char buffer_ [PAGESIZE]
 
std::string file_name_
 
int block_id_
 
int pin_count_
 
bool dirty_
 
bool avaliable_
 
long long last_access_time
 

Detailed Description

The storage details of each page in the memory.

Definition at line 30 of file buffer_manager.h.

Constructor & Destructor Documentation

◆ Page()

Page::Page ( )

Construct a new Page:: Page object.

Definition at line 19 of file buffer_manager.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ initialize()

void Page::initialize ( )

初始化

Definition at line 26 of file buffer_manager.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ avaliable_

bool Page::avaliable_

avaliable标示页是否可以被使用(即将磁盘块load进该页)

Definition at line 53 of file buffer_manager.h.

◆ block_id_

int Page::block_id_

页在所在文件中的块号(磁盘中通常叫块)

Definition at line 50 of file buffer_manager.h.

◆ buffer_

char Page::buffer_[PAGESIZE]

每一页都是一个大小为PAGESIZE字节的数组

Definition at line 48 of file buffer_manager.h.

◆ dirty_

bool Page::dirty_

dirty记录页是否被修改

Definition at line 52 of file buffer_manager.h.

◆ file_name_

std::string Page::file_name_

页所对应的文件名

Definition at line 49 of file buffer_manager.h.

◆ pin_count_

int Page::pin_count_

记录被钉住的次数。被钉住的意思就是不可以被替换

Definition at line 51 of file buffer_manager.h.


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