-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPageLayout.cpp
More file actions
53 lines (44 loc) · 1.01 KB
/
PageLayout.cpp
File metadata and controls
53 lines (44 loc) · 1.01 KB
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
48
49
50
51
52
53
#include "PageLayout.h"
PageLayout::PageLayout(int nPartitions, int nFields, int nBytesPerRecord, int* fToP, int* fToB, int* fToL, int* pToL, int* pToB)
{
numPartitions = nPartitions;
numFields = nFields;
fieldToPartition = fToP;
fieldToByte = fToB;
fieldToLoc = fToL;
partitionToLoc = pToL;
partitionToByte = pToB;
numBytesPerRecord = nBytesPerRecord;
}
int PageLayout::getPartitionStart(int partition) const
{
return partitionToLoc[partition];
}
int PageLayout::getPartitionBytes(int partition) const
{
return partitionToByte[partition];
}
int PageLayout::getNumPartitions() const
{
return numPartitions;
}
int PageLayout::getNumFields() const
{
return numFields;
}
int PageLayout::getFieldsPartition(int fieldNum) const
{
return fieldToPartition[fieldNum];
}
int PageLayout::getFieldsBytes(int fieldNum) const
{
return fieldToByte[fieldNum];
}
int PageLayout::getNBytesPerRec() const
{
return numBytesPerRecord;
}
int PageLayout::getFieldLoc(int fieldNum) const
{
return fieldToLoc[fieldNum];
}