upscaledb  2.2.1
Public Member Functions | Private Attributes
upscaledb::env Class Reference

#include <upscaledb.hpp>

Public Member Functions

 env ()
 
 ~env ()
 
void create (const char *filename, uint32_t flags=0, uint32_t mode=0644, const ups_parameter_t *param=0)
 
void open (const char *filename, uint32_t flags=0, const ups_parameter_t *param=0)
 
void flush (uint32_t flags=0)
 
db create_db (uint16_t name, uint32_t flags=0, const ups_parameter_t *param=0)
 
db open_db (uint16_t name, uint32_t flags=0, const ups_parameter_t *param=0)
 
void rename_db (uint16_t oldname, uint16_t newname, uint32_t flags=0)
 
void erase_db (uint16_t name, uint32_t flags=0)
 
txn begin (const char *name=0, uint32_t flags=0)
 
void close (uint32_t flags=0)
 
void get_parameters (ups_parameter_t *param)
 
std::vector< uint16_tget_database_names ()
 

Private Attributes

ups_env_t_env
 

Detailed Description

An Environment class.

This class wraps the ups_env_t structure.

Definition at line 592 of file upscaledb.hpp.

Constructor & Destructor Documentation

upscaledb::env::env ( )
inline

Constructor

Definition at line 595 of file upscaledb.hpp.

upscaledb::env::~env ( )
inline

Destructor - automatically closes the Environment, if necessary.

!! Any exception is silently discarded. Use of the destructor to close environments is therefore not recommended, because there are valid reasons why an Exception can be thrown (i.e. not all Databases were closed or not all Txns were committed/aborted).

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

Definition at line 610 of file upscaledb.hpp.

References upscaledb::error::get_errno().

Member Function Documentation

txn upscaledb::env::begin ( const char *  name = 0,
uint32_t  flags = 0 
)
inline

Begin a new Txn

Definition at line 681 of file upscaledb.hpp.

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

void upscaledb::env::close ( uint32_t  flags = 0)
inline

Closes the Environment.

Definition at line 691 of file upscaledb.hpp.

References upscaledb::error::error(), UPS_AUTO_CLEANUP, and ups_env_close().

Referenced by run_demo().

void upscaledb::env::create ( const char *  filename,
uint32_t  flags = 0,
uint32_t  mode = 0644,
const ups_parameter_t param = 0 
)
inline

Creates a new Environment.

Definition at line 620 of file upscaledb.hpp.

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

Referenced by run_demo().

db upscaledb::env::create_db ( uint16_t  name,
uint32_t  flags = 0,
const ups_parameter_t param = 0 
)
inline

Creates a new Database in the Environment.

Definition at line 643 of file upscaledb.hpp.

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

Referenced by run_demo().

void upscaledb::env::erase_db ( uint16_t  name,
uint32_t  flags = 0 
)
inline

Deletes a Database from the Environment.

Definition at line 674 of file upscaledb.hpp.

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

void upscaledb::env::flush ( uint32_t  flags = 0)
inline

Flushes the Environment to disk.

Definition at line 636 of file upscaledb.hpp.

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

std::vector<uint16_t> upscaledb::env::get_database_names ( )
inline

Get all Database names.

Definition at line 711 of file upscaledb.hpp.

References upscaledb::error::error(), ups_env_get_database_names(), and UPS_LIMITS_REACHED.

void upscaledb::env::get_parameters ( ups_parameter_t param)
inline

Retrieves Environment parameters.

Definition at line 704 of file upscaledb.hpp.

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

void upscaledb::env::open ( const char *  filename,
uint32_t  flags = 0,
const ups_parameter_t param = 0 
)
inline

Opens an existing Environment.

Definition at line 628 of file upscaledb.hpp.

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

Referenced by run_demo().

db upscaledb::env::open_db ( uint16_t  name,
uint32_t  flags = 0,
const ups_parameter_t param = 0 
)
inline

Opens an existing Database in the Environment.

Definition at line 655 of file upscaledb.hpp.

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

Referenced by run_demo().

void upscaledb::env::rename_db ( uint16_t  oldname,
uint16_t  newname,
uint32_t  flags = 0 
)
inline

Renames an existing Database in the Environment.

Definition at line 667 of file upscaledb.hpp.

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

Field Documentation

ups_env_t* upscaledb::env::_env
private

Definition at line 731 of file upscaledb.hpp.


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