00001 #ifndef LUX_STORAGE_LUXIOBTREE_H
00002 #define LUX_STORAGE_LUXIOBTREE_H
00003
00004 #include <luxio/btree.h>
00005 #include "lux/lux.h"
00006 #include "lux/util.h"
00007 #include "data_unit.h"
00008 #include <cassert>
00009 #include <iostream>
00010 #include <string>
00011
00012 namespace Lux {
00013
00014 class LuxIOBtree {
00015 public:
00016 LuxIOBtree(void);
00017 bool open(const char *filename, db_flags_t open_flags);
00018 bool close(void);
00019 void set_index_type(IO::db_index_t index_type);
00020 void set_cmp_func(IO::CMP cmp);
00021 bool put(LuxDataUnit &key, LuxDataUnit &val);
00022 bool put(LuxDataUnit *key, LuxDataUnit *val);
00023 bool append(LuxDataUnit &key, LuxDataUnit &val);
00024 bool append(LuxDataUnit *key, LuxDataUnit *val);
00025 bool get(LuxDataUnit &key, LuxDataUnit &val);
00026 bool get(LuxDataUnit *key, LuxDataUnit *val);
00027 bool del(LuxDataUnit &key);
00028 bool del(LuxDataUnit *key);
00029
00030 protected:
00031 ~LuxIOBtree(void);
00032
00033 private:
00034 IO::Btree *bt_;
00035 };
00036
00037 }
00038
00039 #endif