source: trunk/gdbm_pool.h @ 26

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

willem

File size: 1.4 KB
Line 
1
2/*
3   Copyright 2013 Willem Vermin, SURFsara
4
5   Licensed under the Apache License, Version 2.0 (the "License");
6   you may not use this file except in compliance with the License.
7   You may obtain a copy of the License at
8
9       http://www.apache.org/licenses/LICENSE-2.0
10
11   Unless required by applicable law or agreed to in writing, software
12   distributed under the License is distributed on an "AS IS" BASIS,
13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16 */
17#ifndef GDBM_POOL_H
18#define GDBM_POOL_H
19#include <string>
20#include "gdbm.h"
21#include "stopos_key.h"
22#include "stopos_pool.h"
23#include "stopos.h"
24 
25class gdbm_pool : public stopos_pool
26{
27  private:
28    GDBM_FILE dbf;          // handle for access database
29    //static const int sync = GDBM_SYNC;
30    static const int sync = 0;
31
32    int get_record(std::string &r,const std::string &k,const std::string &l);
33    int put_record(const std::string &r,const std::string &k,const std::string &l);
34    int remove_record(const std::string &k, const std::string &l);
35
36    std::string key_to_slot(const std::string &k){return "";}
37
38    int ff;
39
40  public:
41    // constructor ()
42    gdbm_pool();
43
44    // destructor
45
46    ~gdbm_pool();
47
48
49    int create_db(const std::string &dbname);
50    int purge_db(void);
51
52    int open_db(void);
53    int close_db(void);
54};
55
56#endif
Note: See TracBrowser for help on using the repository browser.