Go to the documentation of this file.
13 #include <IceUtil/Exception.h>
14 #include <IceUtil/FileUtil.h>
15 #include <Ice/Initialize.h>
16 #include <Ice/OutputStream.h>
17 #include <Ice/InputStream.h>
22 # if defined(ICE_STATIC_LIBS)
24 # elif defined(ICE_DB_API_EXPORTS)
25 # define ICE_DB_API ICE_DECLSPEC_EXPORT
27 # define ICE_DB_API ICE_DECLSPEC_IMPORT
34 #if !defined(ICE_BUILDING_ICE_DB) && defined(ICE_DB_API_EXPORTS)
35 # define ICE_BUILDING_ICE_DB
38 #if defined(_MSC_VER) && !defined(ICE_BUILDING_ICE_DB)
39 # pragma comment(lib, ICE_LIBNAME("IceDB"))
56 #ifndef ICE_CPP11_COMPILER
60 virtual std::string ice_id()
const;
61 virtual void ice_print(std::ostream&)
const;
62 #ifndef ICE_CPP11_MAPPING
65 virtual void ice_throw()
const;
72 static const char* _name;
84 #ifndef ICE_CPP11_COMPILER
88 virtual std::string ice_id()
const;
89 virtual void ice_print(std::ostream&)
const;
90 #ifndef ICE_CPP11_MAPPING
93 virtual void ice_throw()
const;
98 static const char* _name;
110 #ifndef ICE_CPP11_COMPILER
114 virtual std::string ice_id()
const;
115 virtual void ice_print(std::ostream&)
const;
116 #ifndef ICE_CPP11_MAPPING
119 virtual void ice_throw()
const;
124 static const char* _name;
147 template<
typename T,
typename C,
typename H>
154 explicit Env(
const std::string&, MDB_dbi = 0,
size_t = 0,
unsigned int = 0);
159 MDB_env* menv()
const;
165 void operator=(
const Env&);
179 MDB_txn* mtxn()
const;
183 explicit Txn(
const Env&,
unsigned int);
191 void operator=(
const Txn&);
220 MDB_dbi mdbi()
const;
226 DbiBase(
const Txn&,
const std::string&,
unsigned int, MDB_cmp_func*);
231 bool get(
const Txn&, MDB_val*, MDB_val*)
const;
232 void put(
const ReadWriteTxn&, MDB_val*, MDB_val*,
unsigned int);
233 bool find(
const Txn&, MDB_val*)
const;
241 template<
typename K,
typename D,
typename C,
typename H>
246 Dbi(
const Txn& txn,
const std::string& name,
const C& ctx,
unsigned int flags = 0, MDB_cmp_func* cmp = 0) :
247 DbiBase(txn, name, flags, cmp),
248 _marshalingContext(ctx)
338 return _marshalingContext;
343 C _marshalingContext;
352 MDB_cursor* mcursor()
const;
360 bool get(MDB_val*, MDB_val*, MDB_cursor_op);
361 void put(MDB_val*, MDB_val*,
unsigned int);
363 bool find(MDB_val*, MDB_val*);
364 void del(
unsigned int);
373 MDB_cursor* _mcursor;
374 const bool _readOnly;
377 template<
typename K,
typename D,
typename C,
typename H>
447 template<
typename K,
typename D,
typename C,
typename H>
453 Cursor<K, D, C, H>(dbi, txn)
457 void put(
const K& key,
const D&
data,
unsigned int flags = 0)
474 void del(
unsigned int flags = 0)
480 template<
typename K,
typename D,
typename C,
typename H>
486 Cursor<K, D, C, H>(dbi, txn)
510 std::pair<const Ice::Byte*, const Ice::Byte*> p(
static_cast<const Ice::Byte*
>(val.mv_data),
511 static_cast<const Ice::Byte*
>(val.mv_data) + val.mv_size);
516 static void write(
const T& t, MDB_val& val, Ice::OutputStream& holder,
const IceContext& ctx)
520 val.mv_size = holder.b.size();
521 val.mv_data = &holder.b[0];
526 const size_t limit = val.mv_size;
527 std::pair<Ice::Byte*, Ice::Byte*> p(
reinterpret_cast<Ice::Byte*
>(val.mv_data),
528 reinterpret_cast<Ice::Byte*
>(val.mv_data) + limit);
531 val.mv_size = stream.b.size();
532 return stream.b.size() > limit ? false :
true;
Cursor(const Dbi< K, D, C, H > &dbi, const ReadWriteTxn &txn)
bool get(const Txn &, MDB_val *, MDB_val *) const
Ice::EncodingVersion encoding
bool del(const ReadWriteTxn &txn, const K &key)
C marshalingContext() const
void renew(const ReadOnlyTxn &)
bool find(const K &key, D &data)
ICE_DB_API size_t getMapSize(int)
bool find(const Txn &txn, const K &key) const
Dbi(const Txn &txn, const std::string &name, const C &ctx, unsigned int flags=0, MDB_cmp_func *cmp=0)
bool get(K &key, D &data, MDB_cursor_op op)
Ice::CommunicatorPtr communicator
void put(const ReadWriteTxn &txn, const K &key, const D &data, unsigned int flags=0)
void put(const K &key, const D &data, unsigned int flags=0)
void renew(const ReadOnlyTxn &txn)
void put(const ReadWriteTxn &, MDB_val *, MDB_val *, unsigned int)
static void read(T &t, const MDB_val &val, const IceContext &ctx)
void read(auto &eigen, auto *table)
Cursor(const Dbi< K, D, C, H > &dbi, const Txn &txn)
bool get(MDB_val *, MDB_val *, MDB_cursor_op)
bool find(const Txn &, MDB_val *) const
bool get(const Txn &txn, const K &key, D &data) const
ReadOnlyCursor(const Dbi< K, D, C, H > &dbi, const ReadOnlyTxn &txn)
bool del(const ReadWriteTxn &, MDB_val *, MDB_val *)
static void write(const T &t, MDB_val &val, Ice::OutputStream &holder, const IceContext &ctx)
requires data::isWriter< WriterT > void write(WriterT &aron_w, const Eigen::Matrix< EigenT, rows, cols, options > &input, typename WriterT::ReturnType &ret, const armarx::aron::Path &aron_p=armarx::aron::Path())
bool del(const ReadWriteTxn &txn, const K &key, const D &data)
Cursor(const Dbi< K, D, C, H > &dbi, const ReadOnlyTxn &txn)
static bool write(const T &t, MDB_val &val, const IceContext &ctx)
void del(unsigned int flags=0)
ReadWriteCursor(const Dbi< K, D, C, H > &dbi, const ReadWriteTxn &txn)
void put(MDB_val *, MDB_val *, unsigned int)