Commit c24afe01 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 a1db30b4
......@@ -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) {
if (!the_db) {
return the_Env->maybe_throw_error(EINVAL);
......
......@@ -15,6 +15,14 @@ int Dbc::get(Dbt* key, Dbt *data, u_int32_t flags) {
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) {
DBC *dbc = this;
int ret = dbc->c_del(dbc, flags);
......
......@@ -9,8 +9,7 @@ class DbTxn;
class Dbc;
class DbException;
class DbException : public std::exception
{
class DbException : public std::exception {
friend class DbEnv;
public:
~DbException() throw();
......@@ -28,25 +27,22 @@ class DbException : public std::exception
void FillTheWhat(void);
};
class DbDeadlockException : public DbException
{
class DbDeadlockException : public DbException {
public:
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).
class Dbt : private DBT
{
class Dbt : private DBT {
friend class Dbc;
public:
......@@ -179,11 +175,11 @@ class DbTxn {
};
class Dbc : protected DBC
{
class Dbc : protected DBC {
public:
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);
private:
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