hamsterdb Embedded Database  2.1.7
Public Member Functions | Private Attributes
hamsterdb::key Class Reference

#include <hamsterdb.hpp>

Public Member Functions

 key (void *data=0, ham_u16_t size=0, ham_u32_t flags=0)
 
 key (const key &other)
 
keyoperator= (const key &other)
 
void * get_data () const
 
void set_data (void *data)
 
ham_u16_t get_size () const
 
void set_size (ham_u16_t size)
 
template<class T >
void set (T &t)
 
ham_u32_t get_flags () const
 
void set_flags (ham_u32_t flags)
 
ham_key_tget_handle ()
 
int get_approximate_match_type ()
 

Private Attributes

ham_key_t m_key
 

Detailed Description

A key class.

This class wraps structures of type ham_key_t.

Definition at line 89 of file hamsterdb.hpp.

Constructor & Destructor Documentation

hamsterdb::key::key ( void *  data = 0,
ham_u16_t  size = 0,
ham_u32_t  flags = 0 
)
inline

Constructor

Definition at line 92 of file hamsterdb.hpp.

References ham_key_t::data, error(), ham_key_t::flags, HAM_INV_KEYSIZE, m_key, and ham_key_t::size.

hamsterdb::key::key ( const key other)
inline

Copy constructor.

Definition at line 102 of file hamsterdb.hpp.

Member Function Documentation

int hamsterdb::key::get_approximate_match_type ( )
inline

Returns 'sign' of Approximate Match

Definition at line 156 of file hamsterdb.hpp.

References ham_key_get_approximate_match_type(), and m_key.

void* hamsterdb::key::get_data ( ) const
inline

Returns the key data.

Definition at line 114 of file hamsterdb.hpp.

References ham_key_t::data, and m_key.

ham_u32_t hamsterdb::key::get_flags ( ) const
inline

Returns the flags of the key.

Definition at line 141 of file hamsterdb.hpp.

References ham_key_t::flags, and m_key.

ham_key_t* hamsterdb::key::get_handle ( )
inline

Returns a pointer to the internal ham_key_t structure.

Definition at line 151 of file hamsterdb.hpp.

References m_key.

Referenced by hamsterdb::db::erase(), hamsterdb::db::find(), hamsterdb::cursor::find(), hamsterdb::db::insert(), hamsterdb::cursor::insert(), and hamsterdb::cursor::move().

ham_u16_t hamsterdb::key::get_size ( ) const
inline

Returns the size of the key.

Definition at line 124 of file hamsterdb.hpp.

References m_key, and ham_key_t::size.

key& hamsterdb::key::operator= ( const key other)
inline

Assignment operator.

Definition at line 107 of file hamsterdb.hpp.

References m_key.

template<class T >
void hamsterdb::key::set ( T &  t)
inline

Template assignment

Definition at line 135 of file hamsterdb.hpp.

References set_data(), and set_size().

void hamsterdb::key::set_data ( void *  data)
inline

Sets the key data.

Definition at line 119 of file hamsterdb.hpp.

References ham_key_t::data, and m_key.

Referenced by run_demo(), and set().

void hamsterdb::key::set_flags ( ham_u32_t  flags)
inline

Sets the flags of the key.

Definition at line 146 of file hamsterdb.hpp.

References ham_key_t::flags, and m_key.

void hamsterdb::key::set_size ( ham_u16_t  size)
inline

Sets the size of the key.

Definition at line 129 of file hamsterdb.hpp.

References m_key, and ham_key_t::size.

Referenced by run_demo(), and set().

Field Documentation

ham_key_t hamsterdb::key::m_key
private

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