source: tags/0.5/flatfile_pool.h @ 9

Last change on this file since 9 was 9, checked in by willem, 11 years ago

willem

File size: 877 bytes
Line 
1#ifndef FLATFILE_POOL_H
2#define FLATFILE_POOL_H
3#include "stopos_pool.h"
4#include "stopos_key.h"
5
6class flatstatusrecord: statusrecord
7{
8  longuint nextd;
9};
10
11class flatfile_pool: public stopos_pool
12{
13  private:
14    typedef unsigned long long longuint;
15    int ff;    // handle of file to be used
16
17    int get_record(datarecord &r, const stopos_key &k);
18    int put_record(datarecord &r, const stopos_key &k);
19    int remove_record(const stopos_key &k);
20    int get_status(void);
21    int put_status(void);
22    int write_string(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  public:
31    flatfile_pool();
32    int create_db(void);
33    int purge_db(void);
34    int open_db(void);
35    int close_db(void);
36    void dump_db(void);
37};
38#endif
Note: See TracBrowser for help on using the repository browser.