-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.h
78 lines (63 loc) · 1.15 KB
/
data.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*----------------------------------------------------------------------
File : data.h
Contents : data set management
----------------------------------------------------------------------*/
#ifndef _DATA_CLASS
#define _DATA_CLASS
#include <stdio.h>
#include <stdlib.h>
#define TransLen 50
class MapFile;
class Data
{
public:
Data(char *filename);
~Data();
int isOpen();
void close(){if(in)fclose(in);}
long totallength;
int *parseDataFile(MapFile *mapfile);
long currentlength(){
return ftell(in);
}
void caltotallength(){
fseek(in,0,SEEK_END);
totallength=ftell(in);
fseek(in,0,SEEK_SET);
}
private:
FILE *in;
};
/**
chunrong lai, 07-19-2005
**/
class MapFileNode;
class MapFileNode
{
public:
int *TransactionContent;
int size;
int top;
unsigned int MR;
int MC;
char* MB;
MapFileNode* next;
void init(int SIZE, int mul);
void finalize();
};
class MapFile
{
public:
MapFileNode* first;
MapFileNode** table;
int* nodebegin;
int* nodeend;
int *posbegin;
int *posend;
char *shareinfomap;
int tablesize;
void init();
void transform_list_table();
void alloc_work_between_threads(int workingthread);
};
#endif