upscaledb  2.2.1
Public Member Functions | Protected Member Functions | Private Attributes
upscaledb::cursor Class Reference

#include <upscaledb.hpp>

Public Member Functions

 cursor (db *db=0, txn *t=0, uint32_t flags=0)
 
 cursor (txn *t, db *db=0, uint32_t flags=0)
 
 ~cursor ()
 
void create (db *db, txn *t=0, uint32_t flags=0)
 
cursor clone ()
 
void move (key *k, record *r, uint32_t flags=0)
 
void move_first (key *k=0, record *r=0)
 
void move_last (key *k=0, record *r=0)
 
void move_next (key *k=0, record *r=0)
 
void move_previous (key *k=0, record *r=0)
 
void overwrite (record *r, uint32_t flags=0)
 
void find (key *k, record *r=0, uint32_t flags=0)
 
void insert (key *k, record *r, uint32_t flags=0)
 
void erase (uint32_t flags=0)
 
uint32_t get_duplicate_count (uint32_t flags=0)
 
uint32_t get_record_size ()
 
void close ()
 

Protected Member Functions

 cursor (ups_cursor_t *c)
 

Private Attributes

ups_cursor_t_cursor
 

Detailed Description

A Database Cursor.

This class wraps the ups_cursor_t Cursor handles.

Definition at line 436 of file upscaledb.hpp.

Constructor & Destructor Documentation

upscaledb::cursor::cursor ( db db = 0,
txn t = 0,
uint32_t  flags = 0 
)
inline

Constructor

Definition at line 439 of file upscaledb.hpp.

upscaledb::cursor::cursor ( txn t,
db db = 0,
uint32_t  flags = 0 
)
inline

Constructor

Definition at line 445 of file upscaledb.hpp.

upscaledb::cursor::~cursor ( )
inline

Destructor - automatically closes the Cursor, if necessary.

!! Any exception is silently discarded. Use of the destructor to close cursors is therefore not recommended, because there are valid reasons why an Exception can be thrown.

An assert() was added to catch this condition in debug builds.

Definition at line 460 of file upscaledb.hpp.

References upscaledb::error::get_errno().

upscaledb::cursor::cursor ( ups_cursor_t c)
inlineprotected

Definition at line 579 of file upscaledb.hpp.

Member Function Documentation

cursor upscaledb::cursor::clone ( )
inline

Clones the Cursor.

Definition at line 482 of file upscaledb.hpp.

References upscaledb::error::error(), and ups_cursor_clone().

void upscaledb::cursor::close ( )
inline

Closes the Cursor.

Definition at line 568 of file upscaledb.hpp.

References upscaledb::error::error(), and ups_cursor_close().

void upscaledb::cursor::create ( db db,
txn t = 0,
uint32_t  flags = 0 
)
inline

Creates a new Cursor.

Definition at line 470 of file upscaledb.hpp.

References upscaledb::error::error(), upscaledb::db::get_handle(), and ups_cursor_create().

void upscaledb::cursor::erase ( uint32_t  flags = 0)
inline

Erases the current key/record pair.

Definition at line 543 of file upscaledb.hpp.

References upscaledb::error::error(), and ups_cursor_erase().

void upscaledb::cursor::find ( key k,
record r = 0,
uint32_t  flags = 0 
)
inline

Finds a key.

Definition at line 527 of file upscaledb.hpp.

References upscaledb::error::error(), upscaledb::key::get_handle(), and ups_cursor_find().

Referenced by run_demo().

uint32_t upscaledb::cursor::get_duplicate_count ( uint32_t  flags = 0)
inline

Returns the number of duplicate keys.

Definition at line 550 of file upscaledb.hpp.

References upscaledb::error::error(), and ups_cursor_get_duplicate_count().

uint32_t upscaledb::cursor::get_record_size ( )
inline

Returns the size of the current record.

Definition at line 559 of file upscaledb.hpp.

References upscaledb::error::error(), and ups_cursor_get_record_size().

void upscaledb::cursor::insert ( key k,
record r,
uint32_t  flags = 0 
)
inline

Inserts a key/record pair.

Definition at line 535 of file upscaledb.hpp.

References upscaledb::error::error(), upscaledb::key::get_handle(), upscaledb::record::get_handle(), and ups_cursor_insert().

void upscaledb::cursor::move ( key k,
record r,
uint32_t  flags = 0 
)
inline

Moves the Cursor, and retrieves the key/record of the new position.

Definition at line 491 of file upscaledb.hpp.

References upscaledb::error::error(), upscaledb::key::get_handle(), upscaledb::record::get_handle(), and ups_cursor_move().

Referenced by run_demo().

void upscaledb::cursor::move_first ( key k = 0,
record r = 0 
)
inline

Moves the Cursor to the first Database element.

Definition at line 499 of file upscaledb.hpp.

References UPS_CURSOR_FIRST.

void upscaledb::cursor::move_last ( key k = 0,
record r = 0 
)
inline

Moves the Cursor to the last Database element.

Definition at line 504 of file upscaledb.hpp.

References UPS_CURSOR_LAST.

void upscaledb::cursor::move_next ( key k = 0,
record r = 0 
)
inline

Moves the Cursor to the next Database element.

Definition at line 509 of file upscaledb.hpp.

References UPS_CURSOR_NEXT.

Referenced by run_demo().

void upscaledb::cursor::move_previous ( key k = 0,
record r = 0 
)
inline

Moves the Cursor to the previous Database element.

Definition at line 514 of file upscaledb.hpp.

References UPS_CURSOR_PREVIOUS.

void upscaledb::cursor::overwrite ( record r,
uint32_t  flags = 0 
)
inline

Overwrites the current record.

Definition at line 519 of file upscaledb.hpp.

References upscaledb::error::error(), upscaledb::record::get_handle(), and ups_cursor_overwrite().

Field Documentation

ups_cursor_t* upscaledb::cursor::_cursor
private

Definition at line 584 of file upscaledb.hpp.


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