ham::cursor Class Reference

#include <hamsterdb.hpp>

Public Member Functions

 cursor (db *db=0, txn *t=0, ham_u32_t flags=0)
 cursor (txn *t, db *db=0, ham_u32_t flags=0)
 ~cursor ()
void create (db *db, txn *t=0, ham_u32_t flags=0)
cursor clone ()
void move (key *k, record *r, ham_u32_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, ham_u32_t flags=0)
void find (key *k, ham_u32_t flags=0)
void find_ex (key *k, record *r, ham_u32_t flags=0)
void insert (key *k, record *r, ham_u32_t flags=0)
void erase (ham_u32_t flags=0)
ham_u32_t get_duplicate_count (ham_u32_t flags=0)
void close ()

Protected Member Functions

 cursor (ham_cursor_t *c)

Private Attributes

ham_cursor_tm_cursor

Detailed Description

A Database Cursor.

This class wraps the ham_cursor_t Cursor handles.

Definition at line 488 of file hamsterdb.hpp.


Constructor & Destructor Documentation

ham::cursor::cursor ( db db = 0,
txn t = 0,
ham_u32_t  flags = 0 
) [inline]

Constructor

Definition at line 492 of file hamsterdb.hpp.

References create().

Referenced by clone().

ham::cursor::cursor ( txn t,
db db = 0,
ham_u32_t  flags = 0 
) [inline]

Constructor

Definition at line 498 of file hamsterdb.hpp.

References create().

ham::cursor::~cursor (  )  [inline]

Destructor - automatically closes the Cursor, if necessary.

Definition at line 504 of file hamsterdb.hpp.

References close().

ham::cursor::cursor ( ham_cursor_t c  )  [inline, protected]

Definition at line 617 of file hamsterdb.hpp.

References m_cursor.


Member Function Documentation

cursor ham::cursor::clone (  )  [inline]

Clones the Cursor.

Definition at line 522 of file hamsterdb.hpp.

References cursor(), ham_cursor_clone(), and m_cursor.

void ham::cursor::close (  )  [inline]

Closes the Cursor.

Definition at line 606 of file hamsterdb.hpp.

References ham_cursor_close(), and m_cursor.

Referenced by create(), and ~cursor().

void ham::cursor::create ( db db,
txn t = 0,
ham_u32_t  flags = 0 
) [inline]

Creates a new Cursor.

Definition at line 509 of file hamsterdb.hpp.

References close(), ham::db::get_handle(), ham_cursor_create(), and m_cursor.

Referenced by cursor().

void ham::cursor::erase ( ham_u32_t  flags = 0  )  [inline]

Erases the current key/record pair.

Definition at line 590 of file hamsterdb.hpp.

References ham_cursor_erase(), and m_cursor.

void ham::cursor::find ( key k,
ham_u32_t  flags = 0 
) [inline]

Finds a key.

Definition at line 567 of file hamsterdb.hpp.

References ham::key::get_handle(), ham_cursor_find(), and m_cursor.

void ham::cursor::find_ex ( key k,
record r,
ham_u32_t  flags = 0 
) [inline]

Finds a key.

Definition at line 574 of file hamsterdb.hpp.

References ham::record::get_handle(), ham::key::get_handle(), ham_cursor_find_ex(), and m_cursor.

ham_u32_t ham::cursor::get_duplicate_count ( ham_u32_t  flags = 0  )  [inline]

Returns the number of duplicate keys.

Definition at line 597 of file hamsterdb.hpp.

References ham_cursor_get_duplicate_count(), and m_cursor.

void ham::cursor::insert ( key k,
record r,
ham_u32_t  flags = 0 
) [inline]

Inserts a key/record pair.

Definition at line 582 of file hamsterdb.hpp.

References ham::record::get_handle(), ham::key::get_handle(), ham_cursor_insert(), and m_cursor.

void ham::cursor::move ( key k,
record r,
ham_u32_t  flags = 0 
) [inline]

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

Definition at line 531 of file hamsterdb.hpp.

References ham::record::get_handle(), ham::key::get_handle(), ham_cursor_move(), and m_cursor.

Referenced by move_first(), move_last(), move_next(), and move_previous().

void ham::cursor::move_first ( key k = 0,
record r = 0 
) [inline]

Moves the Cursor to the first Database element.

Definition at line 539 of file hamsterdb.hpp.

References HAM_CURSOR_FIRST, and move().

void ham::cursor::move_last ( key k = 0,
record r = 0 
) [inline]

Moves the Cursor to the last Database element.

Definition at line 544 of file hamsterdb.hpp.

References HAM_CURSOR_LAST, and move().

void ham::cursor::move_next ( key k = 0,
record r = 0 
) [inline]

Moves the Cursor to the next Database element.

Definition at line 549 of file hamsterdb.hpp.

References HAM_CURSOR_NEXT, and move().

void ham::cursor::move_previous ( key k = 0,
record r = 0 
) [inline]

Moves the Cursor to the previous Database element.

Definition at line 554 of file hamsterdb.hpp.

References HAM_CURSOR_PREVIOUS, and move().

void ham::cursor::overwrite ( record r,
ham_u32_t  flags = 0 
) [inline]

Overwrites the current record.

Definition at line 559 of file hamsterdb.hpp.

References ham::record::get_handle(), ham_cursor_overwrite(), and m_cursor.


Field Documentation


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

Generated on Tue Mar 16 20:19:45 2010 for hamsterdb Embedded Database by  doxygen 1.6.1