finally methods that actually do something, some testing of them
This commit is contained in:
parent
5fba60f7f0
commit
8cb1e97e30
9 changed files with 348 additions and 12 deletions
29
src/cursor.h
29
src/cursor.h
|
@ -53,23 +53,36 @@ public:
|
|||
std::pair<K, V> prev() const;
|
||||
std::pair<K, V> current() const;
|
||||
|
||||
void first(std::pair<K, V>& out) const;
|
||||
void last(std::pair<K, V>& out) const;
|
||||
void next(std::pair<K, V>& out) const;
|
||||
void prev(std::pair<K, V>& out) const;
|
||||
void current(std::pair<K, V>& out) const;
|
||||
void first(K& key, V& value) const;
|
||||
void last(K& key, V& value) const;
|
||||
void next(K& key, V& value) const;
|
||||
void prev(K& key, V& value) const;
|
||||
void current(K& key, V& value) const;
|
||||
|
||||
private:
|
||||
void terminated() const;
|
||||
void operateCursorRead(K& key, V& value, MDB_cursor_op operation, const std::string& methodName, const std::string& operationName) const;
|
||||
|
||||
private:
|
||||
Storage<K, V>* storage;
|
||||
mutable MDB_cursor* cursor;
|
||||
mutable State state;
|
||||
|
||||
inline static const std::string openRecordMethodName = "Cursor::open"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string closeRecordMethodName = "Cursor::close"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string renewRecordMethodName = "Cursor::renew"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string openCursorMethodName = "Cursor::open"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string closeCursorMethodName = "Cursor::close"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string renewCursorMethodName = "Cursor::renew"; /**<\brief member function name, just for exceptions*/
|
||||
|
||||
inline static const std::string firstMethodName = "first"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string lastMethodName = "last"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string nextMethodName = "next"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string prevMethodName = "prev"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string currentMethodName = "current"; /**<\brief member function name, just for exceptions*/
|
||||
|
||||
inline static const std::string firstOperationName = "Cursor::first"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string lastOperationName = "Cursor::last"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string nextOperationName = "Cursor::next"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string prevOperationName = "Cursor::prev"; /**<\brief member function name, just for exceptions*/
|
||||
inline static const std::string currentOperationName = "Cursor::current"; /**<\brief member function name, just for exceptions*/
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue