⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rm_pagehandle.h

📁 斯坦福大学数据库实现的代码,非常好的.可以了解数据库系统的实现
💻 H
字号:
/* A header is stored in each data page of a paged file page. An * RM_PageSubHeader object is this entire header minus the bitmap for * records. */#ifndef RM_PAGEHEADER_H#define RM_PAGEHEADER_H#include "RM.h"typedef struct {	/* Stores the number of records this page currently holds */	int nRecords;} RM_PageSubHeader;#define RM_PAGESUBHDR_SIZE sizeof(RM_PageSubHeader)/* A slot is a storage area for a record in a page */typedef enum {	EMPTY_SLOT,  /* Slot contains no record */	OCCUPIED_SLOT /* Slot contains a record */} SlotType;class RM_PageHandle {private:	/* Ptr to contents (data) of the page */	char *pData;	/* Stores a copy of the file-sub-header */	RM_FileSubHeader fileSubHeader;	/* Stores a copy of the page-sub-header */	RM_PageSubHeader pageSubHeader;	/* Ptr to the bitmap for slots */	char *pBitmap;public:	  RM_PageHandle (const PF_PageHandle &pfPageHandle, 			  RM_FileSubHeader fileSubHeader);		/* Functions for getting/setting slot types */	SlotType GetSlotType (SlotNum slotNum) const;	void SetSlotType (SlotNum slotNum, SlotType slotType);	/* Returns a ptr to the record at the position slotNum */	void GetRecData (SlotNum slotNum, char *&pData);	/* Returns true if the page cannot accomodate any more records */	bool PageFull () const;};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -