Go to the documentation of this file.
13 #include <Ice/Initialize.h>
14 #include <Ice/InputStream.h>
15 #include <Ice/OutputStream.h>
16 #include <IceUtil/Exception.h>
17 #include <IceUtil/FileUtil.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"))
55 #ifndef ICE_CPP11_COMPILER
59 virtual std::string ice_id()
const;
60 virtual void ice_print(std::ostream&)
const;
61 #ifndef ICE_CPP11_MAPPING
64 virtual void ice_throw()
const;
70 static const char* _name;
81 #ifndef ICE_CPP11_COMPILER
85 virtual std::string ice_id()
const;
86 virtual void ice_print(std::ostream&)
const;
87 #ifndef ICE_CPP11_MAPPING
90 virtual void ice_throw()
const;
94 static const char* _name;
105 #ifndef ICE_CPP11_COMPILER
109 virtual std::string ice_id()
const;
110 virtual void ice_print(std::ostream&)
const;
111 #ifndef ICE_CPP11_MAPPING
114 virtual void ice_throw()
const;
118 static const char* _name;
141 template <
typename T,
typename C,
typename H>
147 explicit Env(
const std::string&, MDB_dbi = 0,
size_t = 0,
unsigned int = 0);
152 MDB_env* menv()
const;
157 void operator=(
const Env&);
170 MDB_txn* mtxn()
const;
173 explicit Txn(
const Env&,
unsigned int);
180 void operator=(
const Txn&);
206 MDB_dbi mdbi()
const;
211 DbiBase(
const Txn&,
const std::string&,
unsigned int, MDB_cmp_func*);
216 bool get(
const Txn&, MDB_val*, MDB_val*)
const;
217 void put(
const ReadWriteTxn&, MDB_val*, MDB_val*,
unsigned int);
218 bool find(
const Txn&, MDB_val*)
const;
225 template <
typename K,
typename D,
typename C,
typename H>
230 const std::string& name,
232 unsigned int flags = 0,
233 MDB_cmp_func* cmp = 0) :
234 DbiBase(txn, name, flags, cmp), _marshalingContext(ctx)
330 return _marshalingContext;
334 C _marshalingContext;
342 MDB_cursor* mcursor()
const;
349 bool get(MDB_val*, MDB_val*, MDB_cursor_op);
350 void put(MDB_val*, MDB_val*,
unsigned int);
352 bool find(MDB_val*, MDB_val*);
353 void del(
unsigned int);
361 MDB_cursor* _mcursor;
362 const bool _readOnly;
365 template <
typename K,
typename D,
typename C,
typename H>
434 template <
typename K,
typename D,
typename C,
typename H>
439 Cursor<K, D, C, H>(dbi, txn)
444 put(
const K& key,
const D&
data,
unsigned int flags = 0)
462 del(
unsigned int flags = 0)
468 template <
typename K,
typename D,
typename C,
typename H>
473 Cursor<K, D, C, H>(dbi, txn)
493 template <
typename T>
499 std::pair<const Ice::Byte*, const Ice::Byte*> p(
500 static_cast<const Ice::Byte*
>(val.mv_data),
501 static_cast<const Ice::Byte*
>(val.mv_data) + val.mv_size);
511 val.mv_size = holder.b.size();
512 val.mv_data = &holder.b[0];
518 const size_t limit = val.mv_size;
519 std::pair<Ice::Byte*, Ice::Byte*> p(
reinterpret_cast<Ice::Byte*
>(val.mv_data),
520 reinterpret_cast<Ice::Byte*
>(val.mv_data) + limit);
523 val.mv_size = stream.b.size();
524 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)
constexpr std::size_t find(string_view str, char_type c) noexcept
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)