strus  0.17
Classes | Public Member Functions | List of all members
strus::DatabaseCursorInterface Class Referenceabstract

Interface to database cursor. More...

#include <databaseCursorInterface.hpp>

Classes

class  Slice
 Chunk data structure without ownership for keys and values of the database cursor. More...
 

Public Member Functions

virtual ~DatabaseCursorInterface ()
 Destructor. More...
 
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. More...
 
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 not by the domain key size. More...
 
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. More...
 
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. More...
 
virtual Slice seekNext ()=0
 Move cursor to the next key stored in the database in the current key domain. More...
 
virtual Slice seekPrev ()=0
 Move cursor to the previous key stored in the database in the current key domain. More...
 
virtual Slice key () const =0
 Get the key of the current element. More...
 
virtual Slice value () const =0
 Get the value of the current element. More...
 

Detailed Description

Interface to database cursor.

Constructor & Destructor Documentation

virtual strus::DatabaseCursorInterface::~DatabaseCursorInterface ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual Slice strus::DatabaseCursorInterface::key ( ) const
pure virtual

Get the key of the current element.

Returns
the key of the current element or an undefined key
virtual Slice strus::DatabaseCursorInterface::seekFirst ( const char *  domainkey,
std::size_t  domainkeysize 
)
pure virtual

Move cursor to the first key stored in the database in a defined key domain.

Parameters
[in]domainkeydefines the key value domain (the subset set of keys to scan)
[in]domainkeysizesize of 'domainkey' in bytes
Returns
the key of the element found or an undefined key
virtual Slice strus::DatabaseCursorInterface::seekLast ( const char *  domainkey,
std::size_t  domainkeysize 
)
pure virtual

Move cursor to the last key stored in the database in a defined key domain.

Parameters
[in]domainkeydefines the key value domain (the subset set of keys to scan)
[in]domainkeysizesize of 'domainkey' in bytes
Returns
the key of the element found or an undefined key
virtual Slice strus::DatabaseCursorInterface::seekNext ( )
pure virtual

Move cursor to the next key stored in the database in the current key domain.

Returns
the key of the element found or an undefined key
virtual Slice strus::DatabaseCursorInterface::seekPrev ( )
pure virtual

Move cursor to the previous key stored in the database in the current key domain.

Returns
the key of the element found or an undefined key
virtual Slice strus::DatabaseCursorInterface::seekUpperBound ( const char *  keystr,
std::size_t  keysize,
std::size_t  domainkeysize 
)
pure virtual

Move cursor to the least upper bound key stored in the database.

Parameters
[in]keystrpointer to the key of the item to seek
[in]keysizesize of 'key' in bytes
[in]domainkeysizesize of 'key' that defines the key value domain (the subset set of keys to search in)
Returns
the key of the element found or an undefined key
virtual Slice strus::DatabaseCursorInterface::seekUpperBoundRestricted ( const char *  keystr,
std::size_t  keysize,
const char *  upkey,
std::size_t  upkeysize 
)
pure virtual

Move cursor to the least upper bound key stored in the database with upper limit specified by key and not by the domain key size.

Parameters
[in]keystrpointer to the key of the item to seek
[in]keysizesize of 'key' in bytes
[in]upkeypointer to the upper limit key that does not belong anymore to the key domain scanned
[in]upkeysizesize of 'upkey' in bytes
Returns
the key of the element found or an undefined key
virtual Slice strus::DatabaseCursorInterface::value ( ) const
pure virtual

Get the value of the current element.

Returns
the value of the current element or an undefined key

The documentation for this class was generated from the following file: