Commit 0b0d4702 authored by Rich Prohaska's avatar Rich Prohaska

add Dbc::pget addresses #234

git-svn-id: file:///svn/tokudb@1430 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7628890f
...@@ -37,6 +37,11 @@ Db::~Db() { ...@@ -37,6 +37,11 @@ Db::~Db() {
} }
} }
int Db::set_flags(u_int32_t flags) {
int ret = the_db->set_flags(the_db, flags);
return the_Env->maybe_throw_error(ret);
}
int Db::close (u_int32_t flags) { int Db::close (u_int32_t flags) {
if (!the_db) { if (!the_db) {
return the_Env->maybe_throw_error(EINVAL); return the_Env->maybe_throw_error(EINVAL);
......
...@@ -15,6 +15,14 @@ int Dbc::get(Dbt* key, Dbt *data, u_int32_t flags) { ...@@ -15,6 +15,14 @@ int Dbc::get(Dbt* key, Dbt *data, u_int32_t flags) {
return env->maybe_throw_error(ret); return env->maybe_throw_error(ret);
} }
int Dbc::pget(Dbt* key, Dbt *pkey, Dbt *data, u_int32_t flags) {
DBC *dbc = this;
int ret = dbc->c_pget(dbc, key, pkey, data, flags);
DB_ENV *dbenv_c=dbc->dbp->dbenv;
DbEnv *env = (DbEnv*)dbenv_c->api1_internal;
return env->maybe_throw_error(ret);
}
int Dbc::del(u_int32_t flags) { int Dbc::del(u_int32_t flags) {
DBC *dbc = this; DBC *dbc = this;
int ret = dbc->c_del(dbc, flags); int ret = dbc->c_del(dbc, flags);
......
...@@ -9,8 +9,7 @@ class DbTxn; ...@@ -9,8 +9,7 @@ class DbTxn;
class Dbc; class Dbc;
class DbException; class DbException;
class DbException : public std::exception class DbException : public std::exception {
{
friend class DbEnv; friend class DbEnv;
public: public:
~DbException() throw(); ~DbException() throw();
...@@ -28,25 +27,22 @@ class DbException : public std::exception ...@@ -28,25 +27,22 @@ class DbException : public std::exception
void FillTheWhat(void); void FillTheWhat(void);
}; };
class DbDeadlockException : public DbException class DbDeadlockException : public DbException {
{
public: public:
DbDeadlockException(DbEnv*); DbDeadlockException(DbEnv*);
}; };
class DbLockNotGrantedException class DbLockNotGrantedException {
{
}; };
class DbMemoryException
{ class DbMemoryException {
}; };
class DbRunRecoveryException
{ class DbRunRecoveryException {
}; };
// DBT and Dbt objects are the same pointers. So watch out if you use Dbt to make other classes (e.g., with subclassing). // DBT and Dbt objects are the same pointers. So watch out if you use Dbt to make other classes (e.g., with subclassing).
class Dbt : private DBT class Dbt : private DBT {
{
friend class Dbc; friend class Dbc;
public: public:
...@@ -179,11 +175,11 @@ class DbTxn { ...@@ -179,11 +175,11 @@ class DbTxn {
}; };
class Dbc : protected DBC class Dbc : protected DBC {
{
public: public:
int close(void); int close(void);
int get(Dbt*, Dbt *, u_int32_t); int get(Dbt *, Dbt *, u_int32_t);
int pget(Dbt *, Dbt *, Dbt *, u_int32_t);
int del(u_int32_t); int del(u_int32_t);
private: private:
Dbc(); // User may not call it. Dbc(); // User may not call it.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment