#include <config_store.hpp>
Public Member Functions | |
configStore (dest_config *conf, LocalDB &ref, t_uid dest, std::string &path, std::string &dbName) | |
Create / open local database. | |
~configStore () | |
Call close(). | |
Db & | getDb () |
Returns DB object. | |
void | flush () |
Writes data to disk. | |
void | save () |
save all entries from hashtable to berkeley db | |
void | save_diff () |
save modified entries from hashtable to berkeley db | |
void | init () |
read all entries from berkeley db to hashtable in LocalDB | |
void | save_size () |
save size of localDB_ to berkeley db | |
long long | read_size () |
read size of berkeley db, if no size found return -1 | |
void | remove_size () |
remove size from berkeley db | |
void | save_transfer () |
save transfer | |
void | remove_ransfer () |
remove transfer | |
void | read_transfer () |
read transfer | |
std::pair< bool, t_traffic > | get_traffic_by_uid (const t_uid &ref) |
fetch stored traffic by uid. | |
Private Member Functions | |
void | close () |
Close berkeley db in nice way. | |
Private Attributes | |
t_uid | dest_ |
dest_config * | conf_ |
LocalDB & | localDB_ |
Db | db_ |
std::string | dbFileName_ |
u_int32_t | cFlags_ |
char * | size_ |
int | size_len_ |
char * | traffic_ |
int | traffic_len_ |
configStore::configStore | ( | dest_config * | conf, | |
LocalDB & | ref, | |||
t_uid | dest, | |||
std::string & | path, | |||
std::string & | dbName | |||
) |
Create / open local database.
configStore::~configStore | ( | ) | [inline] |
Call close().
void configStore::close | ( | ) | [private] |
Close berkeley db in nice way.
Db& configStore::getDb | ( | ) | [inline] |
Returns DB object.
void configStore::flush | ( | ) | [inline] |
Writes data to disk.
void configStore::save | ( | ) |
save all entries from hashtable to berkeley db
void configStore::save_diff | ( | ) |
save modified entries from hashtable to berkeley db
void configStore::init | ( | ) |
read all entries from berkeley db to hashtable in LocalDB
void configStore::save_size | ( | ) |
save size of localDB_ to berkeley db
long long configStore::read_size | ( | ) |
read size of berkeley db, if no size found return -1
void configStore::remove_size | ( | ) |
remove size from berkeley db
void configStore::save_transfer | ( | ) |
save transfer
void configStore::remove_ransfer | ( | ) |
remove transfer
void configStore::read_transfer | ( | ) |
read transfer
fetch stored traffic by uid.
[in] | ref | User ID |
t_uid configStore::dest_ [private] |
dest_config* configStore::conf_ [private] |
LocalDB& configStore::localDB_ [private] |
Db configStore::db_ [private] |
std::string configStore::dbFileName_ [private] |
u_int32_t configStore::cFlags_ [private] |
char* configStore::size_ [private] |
int configStore::size_len_ [private] |
char* configStore::traffic_ [private] |
int configStore::traffic_len_ [private] |