hce-node application
1.4.3
HCE Hierarchical Cluster Engine node application
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
BaseDB.hpp
Go to the documentation of this file.
1
15
#ifndef BASE_DB_HPP
16
#define BASE_DB_HPP
17
18
22
#include <Poco/SharedPtr.h>
23
27
#include <iostream>
28
#include <string>
29
#include <list>
30
31
35
#include "
Errors.hpp
"
36
37
38
namespace
HCE
39
{
40
41
typedef
int
STATUS
;
42
47
class
BaseDB
48
{
49
public
:
50
BaseDB
() :
_error
(
ACTION_SUCCESS
) {}
51
virtual
~BaseDB
() {}
52
public
:
53
typedef
Poco::SharedPtr<HCE::BaseDB>
BaseDBPtr
;
54
public
:
59
virtual
inline
void
setDatabaseName
(
const
std::string& dbName) {
_dbName
= dbName; }
64
virtual
inline
void
setDriverUrl
(
const
std::string& dbUrl) {
_bootstrapUrls
.push_back(dbUrl); }
65
public
:
75
virtual
void
put
(
const
std::string&
key
,
const
std::string& value) = 0;
85
virtual
std::string
get
(
const
std::string&
key
) = 0;
95
virtual
std::vector<std::string>
get_all
() = 0;
105
virtual
void
del
(
const
std::string&
key
) = 0;
111
virtual
int
getLastError
()
const
= 0;
//{ return _error; }
112
public
:
113
inline
void
setWriteUnique
(
const
bool
writeUnique) {
_writeUnique
=writeUnique;}
114
inline
void
setWritePolicy
(
const
bool
writePolicy) {
_writePolicy
=writePolicy;}
115
inline
const
bool
getWriteUnique
()
const
{
return
_writeUnique
;}
116
inline
const
bool
getWritePolicy
()
const
{
return
_writePolicy
;}
117
protected
:
118
std::string
_dbName
;
119
std::list<std::string>
_bootstrapUrls
;
120
STATUS
_error
;
121
bool
_writeUnique
;
122
bool
_writePolicy
;
123
};
124
125
126
}
127
128
129
#endif
sources
utils
kvdb
src
BaseDB.hpp
Generated on Tue Jun 30 2015 19:42:13 for hce-node application by
1.8.1.2