Line | |
---|
1 | #ifndef FLATFILE_POOL_H |
---|
2 | #define FLATFILE_POOL_H |
---|
3 | #include "stopos_pool.h" |
---|
4 | #include "stopos_key.h" |
---|
5 | #include "stopos.h" |
---|
6 | |
---|
7 | class flatstatusrecord: statusrecord |
---|
8 | { |
---|
9 | longuint nextd; |
---|
10 | }; |
---|
11 | |
---|
12 | class flatfile_pool: public stopos_pool |
---|
13 | { |
---|
14 | private: |
---|
15 | int ff; // handle of file to be used |
---|
16 | |
---|
17 | int get_record(std::string &r, const std::string &k); |
---|
18 | int put_record(const std::string &r, const std::string &k); |
---|
19 | int remove_record(const stopos_key &k); |
---|
20 | int get_status(void); |
---|
21 | int put_status(void); |
---|
22 | int write_string(const std::string &r,off_t p); |
---|
23 | int read_string(std::string &r,off_t p); |
---|
24 | |
---|
25 | const static int STATUSTOOLONG = 101; |
---|
26 | |
---|
27 | const static char deleted = 'd'; |
---|
28 | const static char exists = ' '; |
---|
29 | |
---|
30 | std::string get_slot(const std::string &k); |
---|
31 | |
---|
32 | public: |
---|
33 | flatfile_pool(); |
---|
34 | int create_db(void); |
---|
35 | int purge_db(void); |
---|
36 | int open_db(void); |
---|
37 | int close_db(void); |
---|
38 | void dump_db(void); |
---|
39 | }; |
---|
40 | |
---|
41 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.