Berkeley DB Reference Version 5.3.35

Berkeley DB C++ Standard Template Library API Reference

DB C++ STL API Description
Dbstl Global Public Functions 23 members
Dbstl Container Classes 6 members
Db_container 14 members
Db_vector 36 members
Db_map 28 members
Db_multimap 12 members
Db_set 8 members
Db_multiset 8 members
Dbstl Iterator Classes 6 members
Db_base_iterator 10 members
Iterator Classes for db_vector 2 members
Db_vector_base_iterator 24 members
Db_vector_iterator 13 members
Iterator Classes for db_map and db_multimap 2 members
Db_map_base_iterator 14 members
Db_map_iterator 8 members
Iterator Classes for db_set and db_multiset 2 members
Db_set_base_iterator 7 members
Db_set_iterator 7 members
Db_reverse_iterator 13 members
Dbstl Helper Classes 5 members
ElementRef and ElementHolder Wappers 2 members
ElementHolder 18 members
ElementRef 5 members
DbstlDbt 3 members
DbstlElemTraits 34 members
BulkRetrievalOption 6 members
ReadModifyWriteOption 4 members
Dbstl Exception Classes 10 members
DbstlException 3 members
InvalidDbtException 1 members
FailedAssertionException 3 members
InvalidCursorException 1 members
NoSuchKeyException 1 members
NotEnoughMemoryException 1 members
NotSupportedException 1 members
InvalidIteratorException 1 members
InvalidFunctionCall 1 members
InvalidArgumentException 1 members

Dbstl Global Public Functions

Member Description
close_db Close pdb regardless of reference count.
close_all_dbs Close all open database handles regardless of reference count.
close_db_env Close specified database environment handle regardless of reference count.
close_all_db_envs Close all open database environment handles regardless of reference count.
begin_txn Begin a new transaction from the specified environment "env".
commit_txn Commit current transaction opened in the environment "env".
abort_txn Abort current transaction of environment "env".
current_txn Get current transaction of environment "env".
set_current_txn_handle Set environment env's current transaction handle to be newtxn.
register_db Register a Db handle "pdb1".
register_db_env Register a DbEnv handle env1, this handle and handles opened in it will be closed by ResourceManager .
open_db Helper function to open a database and register it into dbstl for the calling thread.
open_env Helper function to open an environment and register it into dbstl for the calling thread.
alloc_mutex Allocate a Berkeley DB mutex.
lock_mutex Lock a mutex, wait if it is held by another thread.
unlock_mutex Unlock a mutex, and return immediately.
free_mutex Free a mutex, and return immediately.
dbstl_startup If there are multiple threads within a process that make use of dbstl, then this function should be called in a single thread mutual exclusively before any use of dbstl in a process; Otherwise, you don't need to call it, but are allowed to call it anyway.
dbstl_exit This function releases any memory allocated in the heap by code of dbstl.
dbstl_thread_exit This function closes all Berkeley DB handles in the right order, if other threads do not use them.
operator== Operators to compare two Dbt objects.
set_global_dbfile_suffix_number If exisiting random temporary database name generation mechanism is still causing name clashes, users can set this global suffix number which will be append to each temporary database file name and incremented after each append, and by default it is 0.
close_db_cursors Close cursors opened in dbp1.

Dbstl Container Classes

Member Description
db_container db_container
db_map db_map
db_multimap db_multimap
db_set db_set
db_multiset db_multiset
db_vector db_vector

Db_container

Member Description
get_db_open_flags Get the backing database's open flags.
get_db_set_flags Get the backing database's flags that are set via Db::set_flags() function.
get_db_handle Get the backing database's handle.
get_db_env_handle Get the backing database environment's handle.
set_db_handle Set the underlying database's handle, and optionally environment handle if the environment has also changed.
set_all_flags Set the flags required by the Berkeley DB functions DbEnv::txn_begin(), DbTxn::commit() and DbEnv::cursor().
set_txn_begin_flags Set flag of DbEnv::txn_begin() call.
get_txn_begin_flags Get flag of DbEnv::txn_begin() call.
set_commit_flags Set flag of DbTxn::commit() call.
get_commit_flags Get flag of DbTxn::commit() call.
get_cursor_open_flags Get flag of Db::cursor() call.
set_cursor_open_flags Set flag of Db::cursor() call.
db_container Default constructor.
~db_container The backing database is not closed in this function.

Db_vector

Member Description
begin Create a read-write or read-only iterator.
end Create an open boundary iterator.
rbegin Create a reverse iterator.
rend Create an open boundary iterator.
max_size Get max size.
capacity Get capacity.
operator[] Index operator, can act as both a left value and a right value.
at Index function.
front Return a reference to the first element.
back Return a reference to the last element.
operator== Container equality comparison operator.
operator!= Container in-equality comparison operator.
operator< Container less than comparison operator.
assign Assign a range [first, last) to this container.
push_front Push an element x into the vector from front.
pop_front Pop out the front element from the vector.
insert Insert x before position pos.
erase Erase element at position pos.
remove Remove all elements whose values are "value" from the list.
remove_if Remove all elements making "pred" return true.
merge Merge content with another container.
unique Remove consecutive duplicate values from this list.
sort Sort this list.
reverse Reverse this list.
splice Moves elements from list x into this list.
size Return the number of elements in this container.
empty Returns whether this container is empty.
db_vector Constructor.
~db_vector
operator= Container assignment operator.
resize Resize this container to specified size n, insert values t if need to enlarge the container.
reserve Reserve space.
push_back Push back an element into the vector.
pop_back Pop out last element from the vector.
swap Swap content with another vector vec.
clear Remove all elements of the vector, make it an empty vector.

Db_map

Member Description
db_map Create a std::map/hash_map equivalent associative container.
~db_map
insert Insert a single key/data pair if the key is not in the container.
begin Begin a read-write or readonly iterator which sits on the first key/data pair of the database.
end Create an open boundary iterator.
rbegin Begin a read-write or readonly reverse iterator which sits on the first key/data pair of the database.
rend Create an open boundary iterator.
is_hash Get container category.
bucket_count Only for std::hash_map, return number of hash bucket in use.
size This function supports auto-commit.
max_size Get max size.
empty Returns whether this container is empty.
erase Erase a key/data pair at specified position.
find Find the key/data pair with specified key x.
lower_bound Find the greatest key less than or equal to x.
equal_range Find the range within which all keys equal to specified key x.
count Count the number of key/data pairs having specified key x.
upper_bound Find the least key greater than x.
key_eq Function to get key compare functor.
hash_funct Function to get hash key generating functor.
value_comp Function to get value compare functor.
key_comp Function to get key compare functor.
operator= Container content assignment operator.
operator[] Retrieve data element by key.
swap Swap content with container mp.
clear Clear contents in this container.
operator== Map content equality comparison operator.
operator!= Container unequality comparison operator.

Db_multimap

Member Description
insert Range insertion.
erase Erase elements by key.
equal_range Find the range within which all keys equal to specified key x.
equal_range_N Find equal range and number of key/data pairs in the range.
count Count the number of key/data pairs having specified key x.
upper_bound Find the least key greater than x.
db_multimap Constructor.
~db_multimap
operator= Container content assignment operator.
swap Swap content with another multimap container.
operator== Returns whether the two containers have identical content.
operator!= Container unequality comparison operator.

Db_set

Member Description
db_set Create a std::set/hash_set equivalent associative container.
~db_set
insert Insert a single key/data pair if the key is not in the container.
operator= Container content assignment operator.
value_comp Get value comparison functor.
swap Swap content with another container.
operator== Set content equality comparison operator.
operator!= Inequality comparison operator.

Db_multiset

Member Description
db_multiset Create a std::multiset/hash_multiset equivalent associative container.
~db_multiset
insert Insert a single key if the key is not in the container.
erase Erase elements by key.
operator= Container content assignment operator.
swap Swap content with another container.
operator== Container content equality compare operator.
operator!= Inequality comparison operator.

Dbstl Iterator Classes

Member Description
db_base_iterator db_base_iterator
db_reverse_iterator db_reverse_iterator
db_map_iterator db_map_iterator
Iterator classes for db_map and db_multimap. Iterator classes for db_map and db_multimap.
Iterator classes for db_set and db_multiset. Iterator classes for db_set and db_multiset.
Iterator classes for db_vector. Iterator classes for db_vector.

Db_base_iterator

Member Description
refresh Read data from underlying database via its cursor, and update its cached value.
close_cursor Close its cursor.
set_bulk_buffer Call this function to modify bulk buffer size.
get_bulk_bufsize Return current bulk buffer size.
db_base_iterator Default constructor.
operator= Iterator assignment operator.
~db_base_iterator Destructor.
get_bulk_retrieval Get bulk buffer size.
is_rmw Get DB_RMW setting.
is_directdb_get Get direct database get setting.

Iterator Classes for db_vector

Member Description
db_vector_base_iterator db_vector_base_iterator
db_vector_iterator db_vector_iterator

Db_vector_base_iterator

Member Description
db_vector_base_iterator
~db_vector_base_iterator
operator== Equality comparison operator.
operator!= Unequal compare, identical to !operator(==itr).
operator< Less than comparison operator.
operator<= Less equal comparison operator.
operator>= Greater equal comparison operator.
operator> Greater comparison operator.
operator++ Pre-increment.
operator-- Pre-decrement.
operator= Assignment operator.
operator+ Iterator movement operator.
operator+= Move this iterator backward by n elements.
operator- Iterator movement operator.
operator-= Move this iterator forward by n elements.
operator * Dereference operator.
operator-> Arrow operator.
operator[] Iterator index operator.
get_current_index Get current index of within the vector.
move_to Iterator movement function.
refresh Refresh iterator cached value.
close_cursor Close underlying Berkeley DB cursor of this iterator.
set_bulk_buffer Modify bulk buffer size.
get_bulk_bufsize Get bulk retrieval buffer size in bytes.

Db_vector_iterator

Member Description
db_vector_iterator
~db_vector_iterator
operator++ Pre-increment.
operator-- Pre-decrement.
operator= Assignment operator.
operator+ Iterator movement operator.
operator+= Move this iterator backward by n elements.
operator- Iterator movement operator.
operator-= Move this iterator forward by n elements.
operator * Dereference operator.
operator-> Arrow operator.
operator[] Iterator index operator.
refresh Refresh iterator cached value.

Iterator Classes for db_map and db_multimap

Member Description
db_map_base_iterator db_map_base_iterator
db_map_iterator db_map_iterator

Db_map_base_iterator

Member Description
db_map_base_iterator Copy constructor.
~db_map_base_iterator Destructor.
operator++ Pre-increment.
operator-- Pre-decrement.
operator== Equal comparison operator.
operator!= Unequal comparison operator.
operator * Dereference operator.
operator-> Arrow operator.
refresh Refresh iterator cached value.
close_cursor Close underlying Berkeley DB cursor of this iterator.
move_to Iterator movement function.
set_bulk_buffer Modify bulk buffer size.
get_bulk_bufsize Get bulk retrieval buffer size in bytes.
operator= Assignment operator.

Db_map_iterator

Member Description
db_map_iterator Copy constructor.
~db_map_iterator Destructor.
operator++ Pre-increment.
operator-- Pre-decrement.
operator * Dereference operator.
operator-> Arrow operator.
refresh Refresh iterator cached value.
operator= Assignment operator.

Iterator Classes for db_set and db_multiset

Member Description
db_set_base_iterator db_set_base_iterator
db_set_iterator db_set_iterator

Db_set_base_iterator

Member Description
~db_set_base_iterator Destructor.
db_set_base_iterator Constructor.
operator++ Post-increment.
operator-- Post-decrement.
operator * Dereference operator.
operator-> Arrow operator.
refresh Refresh iterator cached value.

Db_set_iterator

Member Description
~db_set_iterator Destructor.
db_set_iterator Constructor.
operator++ Pre-increment.
operator-- Pre-decrement.
operator * Dereference operator.
operator-> Arrow operator.
refresh Refresh iterator cached value.

Db_reverse_iterator

Member Description
operator++ Move this iterator forward by one element.
operator-- Move this iterator backward by one element.
operator+ Iterator shuffle operator.
operator- Iterator shuffle operator.
operator+= Iterator shuffle operator.
operator-= Iterator shuffle operator.
operator< Less compare operator.
operator> Greater compare operator.
operator<= Less equal compare operator.
operator>= Greater equal compare operator.
db_reverse_iterator Constructor. Construct from an iterator of wrapped type.
operator= Assignment operator.
operator[] Return the reference of the element which can be reached by moving this reverse iterator by Off times backward.

Dbstl Helper Classes

Member Description
BulkRetrievalOption BulkRetrievalOption
ReadModifyWriteOption ReadModifyWriteOption
DbstlElemTraits DbstlElemTraits
DbstlDbt DbstlDbt
ElementRef and ElementHolder wrappers. ElementRef and ElementHolder wrappers.

ElementRef and ElementHolder Wappers

Member Description
ElementRef ElementRef
ElementHolder ElementHolder

ElementHolder

Member Description
ElementHolder Constructor.
~ElementHolder Destructor.
operator+=
operator-=
operator *=
operator/=
operator%=
operator &=
<a href="stlElementHolderoperator_oa.html" class="xref" title="operator =">operator
operator^=
operator>>=
operator<<=
operator++
operator--
operator=
operator ptype This operator is a type converter.
_DB_STL_value Returns the data element this wrapper object wraps;.
_DB_STL_StoreElement Function to store the data element.

ElementRef

Member Description
~ElementRef Destructor.
ElementRef Constructor.
operator= Assignment Operator.
_DB_STL_StoreElement Function to store the data element.
_DB_STL_value Returns the data element this wrapper object wraps.

DbstlDbt

Member Description
DbstlDbt Construct an object with an existing chunk of memory of size1 bytes, refered by data1,.
~DbstlDbt The memory will be free'ed by the destructor.
operator= The memory will be reallocated if neccessary.

DbstlElemTraits

Member Description
assign Assignone object to another.
eq Check for equality of two objects.
lt Less than comparison.
compare Sequence comparison.
length Returns the number of elements in sequence seq1.
copy Copy first cnt number of elements from seq2 to seq1.
find Find within the first cnt elements of sequence seq the position of element equal to elem.
move Sequence movement.
to_char_type
to_int_type
eq_int_type
eof
not_eof
set_restore_function
get_restore_function
set_assign_function
get_assign_function
get_size_function
set_size_function
get_copy_function
set_copy_function
set_sequence_len_function
get_sequence_len_function
get_sequence_copy_function
set_sequence_copy_function
set_compare_function
get_compare_function
set_sequence_compare_function
get_sequence_compare_function
set_sequence_n_compare_function
get_sequence_n_compare_function
instance Factory method to create a singeleton instance of this class.
~DbstlElemTraits
DbstlElemTraits

BulkRetrievalOption

Member Description
BulkRetrievalOption
operator== Equality comparison.
operator= Assignment operator.
bulk_buf_size Return the buffer size set to this object.
bulk_retrieval This function indicates that you need a bulk retrieval iterator, and it can be also used to optionally set the bulk read buffer size.
no_bulk_retrieval This function indicates that you do not need a bulk retrieval iterator.

ReadModifyWriteOption

Member Description
operator= Assignment operator.
operator== Equality comparison.
read_modify_write Call this function to tell the container's begin() function that you need a read-modify-write iterator.
no_read_modify_write Call this function to tell the container's begin() function that you do not need a read-modify-write iterator.

Dbstl Exception Classes

Member Description
DbstlException DbstlException
NotEnoughMemoryException NotEnoughMemoryException
InvalidIteratorException InvalidIteratorException
InvalidCursorException InvalidCursorException
InvalidDbtException InvalidDbtException
FailedAssertionException FailedAssertionException
NoSuchKeyException NoSuchKeyException
InvalidArgumentException InvalidArgumentException
NotSupportedException NotSupportedException
InvalidFunctionCall InvalidFunctionCall

DbstlException

Member Description
DbstlException
operator=
~DbstlException

InvalidDbtException

Member Description
InvalidDbtException

FailedAssertionException

Member Description
what
FailedAssertionException
~FailedAssertionException

InvalidCursorException

Member Description
InvalidCursorException

NoSuchKeyException

Member Description
NoSuchKeyException

NotEnoughMemoryException

Member Description
NotEnoughMemoryException

NotSupportedException

Member Description
NotSupportedException

InvalidIteratorException

Member Description
InvalidIteratorException

InvalidFunctionCall

Member Description
InvalidFunctionCall

InvalidArgumentException

Member Description
InvalidArgumentException

Legal Notice

This documentation is distributed under an open source license. You may review the terms of this license at: http://www.oracle.com/technetwork/database/berkeleydb/downloads/oslicense-093458.html

Oracle, Berkeley DB, and Sleepycat are trademarks or registered trademarks of Oracle. All rights to these marks are reserved. No third-party use is permitted without the express prior written consent of Oracle.

Other names may be trademarks of their respective owners.

To obtain a copy of this document's original source code, please submit a request to the Oracle Technology Network forum at: http://forums.oracle.com/forums/forum.jspa?forumID=271

9/9/2013