upscaledb  2.1.13
Public Member Functions | Private Attributes
upscaledb::key Class Reference

#include <upscaledb.hpp>

Public Member Functions

 key (void *data=0, uint16_t size=0, uint32_t flags=0)
 
 key (const key &other)
 
keyoperator= (const key &other)
 
void * get_data () const
 
void set_data (void *data)
 
uint16_t get_size () const
 
void set_size (uint16_t size)
 
template<class T >
void set (T &t)
 
uint32_t get_flags () const
 
void set_flags (uint32_t flags)
 
ups_key_tget_handle ()
 

Private Attributes

ups_key_t m_key
 

Detailed Description

A key class.

This class wraps structures of type ups_key_t.

Definition at line 91 of file upscaledb.hpp.

Constructor & Destructor Documentation

upscaledb::key::key ( void *  data = 0,
uint16_t  size = 0,
uint32_t  flags = 0 
)
inline

Constructor

Definition at line 94 of file upscaledb.hpp.

References ups_key_t::data, error(), ups_key_t::flags, m_key, ups_key_t::size, and UPS_INV_KEYSIZE.

upscaledb::key::key ( const key other)
inline

Copy constructor.

Definition at line 104 of file upscaledb.hpp.

Member Function Documentation

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

Returns the key data.

Definition at line 116 of file upscaledb.hpp.

References ups_key_t::data, and m_key.

uint32_t upscaledb::key::get_flags ( ) const
inline

Returns the flags of the key.

Definition at line 143 of file upscaledb.hpp.

References ups_key_t::flags, and m_key.

ups_key_t* upscaledb::key::get_handle ( )
inline

Returns a pointer to the internal ups_key_t structure.

Definition at line 153 of file upscaledb.hpp.

References m_key.

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

uint16_t upscaledb::key::get_size ( ) const
inline

Returns the size of the key.

Definition at line 126 of file upscaledb.hpp.

References m_key, and ups_key_t::size.

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

Assignment operator.

Definition at line 109 of file upscaledb.hpp.

References m_key.

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

Template assignment

Definition at line 137 of file upscaledb.hpp.

References set_data(), and set_size().

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

Sets the key data.

Definition at line 121 of file upscaledb.hpp.

References ups_key_t::data, and m_key.

Referenced by run_demo(), and set().

void upscaledb::key::set_flags ( uint32_t  flags)
inline

Sets the flags of the key.

Definition at line 148 of file upscaledb.hpp.

References ups_key_t::flags, and m_key.

void upscaledb::key::set_size ( uint16_t  size)
inline

Sets the size of the key.

Definition at line 131 of file upscaledb.hpp.

References m_key, and ups_key_t::size.

Referenced by run_demo(), and set().

Field Documentation

ups_key_t upscaledb::key::m_key
private

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