-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBGM_StudentFileManager.h
44 lines (34 loc) · 991 Bytes
/
BGM_StudentFileManager.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
#ifndef __BGM_STUDENTSFILEMANAGER__
#define __BGM_STUDENTSFILEMANAGER__
// numberOfEntry nextSlot mask empty students
// 0 (4byte) 4 (4byte) 8(4byte) 12 (18byte) 30 (38*107 = 4066byte)
#include "BGM_DataFileManager.h"
#include "Student.h"
#define STUDENTFILEMANAGER_MASK_OFFSET 12
#define DATALIST_OFFSET 30
#define STUDENTS_PER_BLOCK 107
namespace BGM
{
class StudentFileManager : public DataFileManager<Student>
{
private:
unsigned & mask;
virtual Student searchData(const Student& student); //¿¹¿Üó¸® ºÒ°¡. »ç¿ë ¾ÈÇÔ
virtual void deleteData(const Student& student);
public:
StudentFileManager(const char* fileName);
unsigned getMask(void) const;
void setMask(unsigned m);
bool isFull() const;
void deleteData(signed int index);
void deleteData(unsigned id);
float getScore(blockId_t block, unsigned ID);
//for debug
void printBlock();
};
inline bool StudentFileManager::isFull() const
{
return numberOfData==STUDENTS_PER_BLOCK;
}
}
#endif