-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrm_rid.h
47 lines (37 loc) · 1.01 KB
/
rm_rid.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// rm_rid.h
//
// The Record Id interface
//
#ifndef RM_RID_H
#define RM_RID_H
// We separate the interface of RID from the rest of RM because some
// components will require the use of RID but not the rest of RM.
#include "redbase.h"
//
// PageNum: uniquely identifies a page in a file
//
typedef int PageNum;
//
// SlotNum: uniquely identifies a record in a page
//
typedef int SlotNum;
//
// RID: Record id interface
//
class RID {
public:
RID(); // Default constructor
RID(PageNum pageNum, SlotNum slotNum);
~RID(); // Destructor
RID& operator=(const RID &rid); // Overloaded =
bool operator==(const RID &rid) const ; // Overloaded ==
RC GetPageNum(PageNum &pageNum) const; // Return page number
RC GetSlotNum(SlotNum &slotNum) const; // Return slot number
private:
// Copy constructor
RID(const RID &rid);
PageNum pageNum;
SlotNum slotNum;
};
#endif