#include <OW_dbDatabase.hpp>
Public Types | ||||
enum | EDuplicateKeysFlag { E_NO_DUPLICATES, E_DUPLICATES } | |||
Public Member Functions | ||||
dbDatabase () | ||||
~dbDatabase () | ||||
Destructor. | ||||
void | open (const char *name,::DB_ENV *env,::DB_TXN *txn, EDuplicateKeysFlag allowDuplicates=E_NO_DUPLICATES) | |||
Open the given db file. | ||||
void | close () | |||
Close the underlying database if it is open. | ||||
bool | get (const String &key, std::vector< unsigned char > &data,::DB_TXN *txn) | |||
Get the data associated with key. | ||||
void | put (const String &key, const std::vector< unsigned char > &data,::DB_TXN *txn) | |||
Put data into the database
| ||||
Private Attributes | ||||
::DB * | m_db |
Definition at line 45 of file OW_dbDatabase.hpp.
|
Definition at line 59 of file OW_dbDatabase.hpp. |
|
Definition at line 47 of file OW_dbDatabase.cpp. |
|
Destructor. This will close the database if it is open. It is recommended that close be called separately so that exceptions may be caught and reported. The destructor will not throw exceptions. Definition at line 53 of file OW_dbDatabase.cpp. References close(). |
|
Close the underlying database if it is open.
Definition at line 87 of file OW_dbDatabase.cpp. References OW_NAMESPACE::dbUtils::checkReturn(), and m_db. Referenced by OW_NAMESPACE::MetaRepository2::close(), OW_NAMESPACE::InstanceRepository2::close(), OW_NAMESPACE::AssocDb2::close(), and ~dbDatabase(). |
|
Get the data associated with key.
Definition at line 98 of file OW_dbDatabase.cpp. References OW_NAMESPACE::String::c_str(), OW_NAMESPACE::dbUtils::checkReturn(), OW_NAMESPACE::String::length(), and m_db. |
|
Open the given db file.
Definition at line 65 of file OW_dbDatabase.cpp. References OW_NAMESPACE::dbUtils::checkReturn(), E_DUPLICATES, and m_db. Referenced by OW_NAMESPACE::MetaRepository2::open(), OW_NAMESPACE::InstanceRepository2::open(), and OW_NAMESPACE::AssocDb2::open(). |
|
Put data into the database
Definition at line 116 of file OW_dbDatabase.cpp. References OW_NAMESPACE::String::c_str(), OW_NAMESPACE::dbUtils::checkReturn(), OW_NAMESPACE::String::length(), and m_db. |
|
Definition at line 92 of file OW_dbDatabase.hpp. |