wavelength 1.0.0
Loading...
Searching...
No Matches
Block.h
Go to the documentation of this file.
1#pragma once
2
4const int kNumBlockBuffers = 8;
5
7const int kSectorSize = 2048;
8
14extern int kBlockSize;
15
21class Block {
22public:
29
36
43 static int NextBufferIndex();
44
51 static int CurrentTimestamp();
52
53 char *mBuffer;
54 int mBlockNum;
55 int mTimestamp;
56};
57
63extern int gCurrBuffNum;
64
70extern int gBlockTimestamp;
int kBlockSize
Bytes of one block, the unit the block manager reads from the archive.
int gCurrBuffNum
Number of block buffers taken.
const int kSectorSize
Bytes of one disc sector.
Definition Block.h:7
const int kNumBlockBuffers
Number of block buffers.
Definition Block.h:4
int gBlockTimestamp
Latest block timestamp.
One block buffer of the disc cache.
Definition blockmgr.h:15
Block()
Take the next free block buffer and mark the block as just used.
static int NextBufferIndex()
Take the index of the next free block buffer.
void UpdateTimestamp()
Mark the block as just used.
static int CurrentTimestamp()
Report the latest timestamp.