10 #ifndef _STRUS_DATABASE_CURSOR_INTERFACE_HPP_INCLUDED
11 #define _STRUS_DATABASE_CURSOR_INTERFACE_HPP_INCLUDED
31 Slice(
const char* ptr_, std::size_t size_)
32 :m_ptr(ptr_),m_size(size_){}
36 :m_ptr(o.m_ptr),m_size(o.m_size){}
40 const char*
ptr()
const {
return m_ptr;}
43 std::size_t
size()
const {
return m_size;}
46 std::string
tostring()
const {
return std::string(m_ptr,m_size);}
48 operator std::string()
const {
return std::string(m_ptr,m_size);}
70 std::size_t domainkeysize)=0;
82 std::size_t upkeysize)=0;
89 const char* domainkey,
90 std::size_t domainkeysize)=0;
97 const char* domainkey,
98 std::size_t domainkeysize)=0;
110 virtual Slice
key()
const=0;
114 virtual Slice
value()
const=0;
std::size_t size() const
Get the size of the data in bytes.
Definition: databaseCursorInterface.hpp:43
virtual ~DatabaseCursorInterface()
Destructor.
Definition: databaseCursorInterface.hpp:60
Interface to database cursor.
Definition: databaseCursorInterface.hpp:18
virtual Slice seekNext()=0
Move cursor to the next key stored in the database in the current key domain.
Chunk data structure without ownership for keys and values of the database cursor.
Definition: databaseCursorInterface.hpp:22
bool defined() const
Evaluate if the chunk is defined or a NULL reference.
Definition: databaseCursorInterface.hpp:51
virtual Slice key() const =0
Get the key of the current element.
Slice()
Defaul constructor.
Definition: databaseCursorInterface.hpp:26
virtual Slice seekPrev()=0
Move cursor to the previous key stored in the database in the current key domain. ...
virtual Slice seekUpperBoundRestricted(const char *keystr, std::size_t keysize, const char *upkey, std::size_t upkeysize)=0
Move cursor to the least upper bound key stored in the database with upper limit specified by key and...
Slice(const Slice &o)
Copy constructor.
Definition: databaseCursorInterface.hpp:35
std::string tostring() const
Return the data as a string.
Definition: databaseCursorInterface.hpp:46
const char * ptr() const
Get the pointer to data.
Definition: databaseCursorInterface.hpp:40
virtual Slice value() const =0
Get the value of the current element.
virtual Slice seekFirst(const char *domainkey, std::size_t domainkeysize)=0
Move cursor to the first key stored in the database in a defined key domain.
Slice(const char *ptr_, std::size_t size_)
Constructor.
Definition: databaseCursorInterface.hpp:31
virtual Slice seekLast(const char *domainkey, std::size_t domainkeysize)=0
Move cursor to the last key stored in the database in a defined key domain.
virtual Slice seekUpperBound(const char *keystr, std::size_t keysize, std::size_t domainkeysize)=0
Move cursor to the least upper bound key stored in the database.