-
Notifications
You must be signed in to change notification settings - Fork 0
/
rec_db.hpp
57 lines (42 loc) · 987 Bytes
/
rec_db.hpp
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
#ifndef _REC_DB_HPP
#define _REC_DB_HPP
#include <string>
// forward decls
namespace BDB{
struct BehaviorDB;
struct Config;
}
class BDBIDX;
namespace rec_db {
/** A record DB wraps BDBIDX and BehaviorDB
*/
class db
{
public:
/** @brief Constructor
* @param conf Configuration
* @see BehaviorDB::Config
*/
db(BDB::Config const& conf);
~db();
/// put data to db with an unique key
bool
put(std::string const& key, std::string const& data);
/// get data according to a key
bool
get(std::string *output, std::string key);
/// del data according to a key
bool
del(std::string const& key);
/// update(replace) data according to a key
bool
update(std::string const& key, std::string const& data);
private:
// non-copyable
db(db const &cp);
db& operator=(db const &db);
BDB::BehaviorDB *store_;
BDBIDX *idx_;
};
} // namespace rec_db
#endif // header guard