Home Libraries Author Links

stm::db::set< Key, Compare, Allocator, Policy, Traits > Class Template Reference
[DbMap: Named Persistent Associative ContainersClass template db::set]

#include <dbmap.hpp>

List of all members.


Detailed Description

template<class Key, class Compare = std::less<Key>, class Allocator = std::allocator<Key>, class Policy = default_policy<0>, class Traits = default_traits<Allocator>>
class stm::db::set< Key, Compare, Allocator, Policy, Traits >

The db::set class template is a kind of associative container that supports unique keys (contains at most one of each key value) and provides for fast retrieval based on these keys.

The db::set class template supports bidirectional iterators (24.1.4). A db::set satisfies all of the requirements of a container and of a reversible container (23.1) and of an associative container (23.1.2). A db::set also provides most operations described in (23.1.2) for unique keys. This means that a db::set supports the a_uniq operations in (23.1.2) but not the a_eq operations. For a db::set<Key> the key_type is Key and the value_type is also Key. Class template db::set is modelled after the container std::set (23.3.3) and additionally permits named persistent storage of its contents as its implemention is based on the Berkeley database engine. So by means of db::set iterators arbitrary big containers are effectively manageable. Descriptions are provided here only for operations on db::set that are not described in (23.3.3) for std::set and for operations where there is additional semantic information.

Definition at line 1055 of file dbmap.hpp.


Type definitions

typedef set< Key, Compare,
Allocator, Policy, Traits > 
db_type
typedef Key key_type
typedef key_type value_type
typedef Compare key_compare
typedef Compare value_compare
typedef Allocator allocator_type
typedef Policy policy_type
typedef Traits traits_type
typedef Allocator::reference reference
typedef Allocator::const_reference const_reference
typedef Allocator::pointer pointer
typedef Allocator::const_pointer const_pointer
typedef proxy::iterator iterator
typedef proxy::const_iterator const_iterator
typedef proxy::reverse_iterator reverse_iterator
typedef
proxy::const_reverse_iterator 
const_reverse_iterator
typedef traits_type::size_type size_type
typedef
traits_type::difference_type 
difference_type
typedef traits_type::char_type char_type
typedef traits_type::string_type string_type
typedef policy_type::flags_type flags_type
 Bitmask type.

Flag value definitions

///////////////////////////////////////////////////////////////////////

static const flags_type noflags = proxy::noflags
static const flags_type truncate = proxy::truncate
static const flags_type forceendiancvt = proxy::forceendiancvt
static const flags_type multiprocessing = proxy::multiprocessing

Construction and destruction

///////////////////////////////////////////////////////////////////////

 set ()
 Default constructor.
 set (const string_type &name, flags_type flags=noflags, const key_compare &comp=key_compare(), const allocator_type &alloc=allocator_type())
 If name is empty, the db::set is not stored persistently on disk.
template<class InputIterator>
 set (InputIterator first, InputIterator last, const string_type &name=string_type(), flags_type flags=noflags, const key_compare &comp=key_compare(), const allocator_type &alloc=allocator_type())
 If name is empty, the db::set is not stored persistently on disk.
 set (const set< Key, Compare, Allocator, Policy, Traits > &rhs, const string_type &name=string_type())
 If name is empty, the db::set is not stored persistently on disk.
set< Key, Compare, Allocator,
Policy, Traits > & 
operator= (const set< Key, Compare, Allocator, Policy, Traits > &rhs)
 Assignment is only allowed for a non persistent right hand side.
void swap (set< Key, Compare, Allocator, Policy, Traits > &other) throw ()
 Swap this db::set object with the db::set object other.
 ~set ()

Iterators

///////////////////////////////////////////////////////////////////////

iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const

Capacity

///////////////////////////////////////////////////////////////////////

bool empty () const
size_type size () const
size_type max_size () const

Modifiers

///////////////////////////////////////////////////////////////////////

iterator insert (iterator hint, const value_type &value)
std::pair< typename
db_type::iterator, bool > 
insert (const value_type &value)
template<typename InputIterator>
void insert (InputIterator first, InputIterator last)
void erase (iterator position)
size_type erase (const key_type &key)
void erase (iterator first, iterator last)
void clear ()

Observers

///////////////////////////////////////////////////////////////////////

key_compare key_comp () const
value_compare value_comp () const
allocator_type get_allocator () const
bool endiancvt () const
flags_type get_flags () const
const string_typeget_name () const

db::set key operations

///////////////////////////////////////////////////////////////////////

iterator find (const key_type &key)
const_iterator find (const key_type &key) const
reverse_iterator rfind (const key_type &key)
const_reverse_iterator rfind (const key_type &key) const
size_type count (const key_type &key) const
iterator lower_bound (const key_type &key)
const_iterator lower_bound (const key_type &key) const
iterator upper_bound (const key_type &key)
const_iterator upper_bound (const key_type &key) const
std::pair< iterator, iterator > equal_range (const key_type &key)
std::pair< const_iterator,
const_iterator > 
equal_range (const key_type &key) const

Private Types

typedef local::pxmap< Key,
null_type, Compare, Allocator,
Policy, Traits, false > 
proxy

Classes

class  locker
 xxx More...

Member Typedef Documentation

template<class Key, class Compare = std::less<Key>, class Allocator = std::allocator<Key>, class Policy = default_policy<0>, class Traits = default_traits<Allocator>>
typedef policy_type::flags_type stm::db::set< Key, Compare, Allocator, Policy, Traits >::flags_type

Bitmask type.

Definition at line 1101 of file dbmap.hpp.


Constructor & Destructor Documentation

template<class Key, class Compare, class Allocator, class Policy, class Traits>
stm::db::set< Key, Compare, Allocator, Policy, Traits >::set (  )  [inline]

Default constructor.

Definition at line 4643 of file dbxmap.hpp.

template<class Key, class Compare, class Allocator, class Policy, class Traits>
stm::db::set< Key, Compare, Allocator, Policy, Traits >::set ( const string_type name,
flags_type  flags = noflags,
const key_compare &  comp = key_compare (),
const allocator_type &  alloc = allocator_type () 
) [inline, explicit]

If name is empty, the db::set is not stored persistently on disk.

Definition at line 4648 of file dbxmap.hpp.

template<class Key, class Compare, class Allocator, class Policy, class Traits>
template<class InputIterator>
stm::db::set< Key, Compare, Allocator, Policy, Traits >::set ( InputIterator  first,
InputIterator  last,
const string_type name = string_type (),
flags_type  flags = noflags,
const key_compare &  comp = key_compare (),
const allocator_type &  alloc = allocator_type () 
) [inline]

If name is empty, the db::set is not stored persistently on disk.

Definition at line 4661 of file dbxmap.hpp.

template<class Key, class Compare, class Allocator, class Policy, class Traits>
stm::db::set< Key, Compare, Allocator, Policy, Traits >::set ( const set< Key, Compare, Allocator, Policy, Traits > &  rhs,
const string_type name = string_type () 
) [inline]

If name is empty, the db::set is not stored persistently on disk.

Only allowed, if the constructed db::set is not persistent, or if it has a name different from that of the right hand side.

Definition at line 4677 of file dbxmap.hpp.

References stm::db::set< Key, Compare, Allocator, Policy, Traits >::begin(), stm::db::set< Key, Compare, Allocator, Policy, Traits >::end(), stm::db::set< Key, Compare, Allocator, Policy, Traits >::get_name(), and StmDebugAidsErrmsg.


Member Function Documentation

template<class Key, class Compare, class Allocator, class Policy, class Traits>
set< Key, Compare, Allocator, Policy, Traits > & stm::db::set< Key, Compare, Allocator, Policy, Traits >::operator= ( const set< Key, Compare, Allocator, Policy, Traits > &  rhs  )  [inline]

Assignment is only allowed for a non persistent right hand side.

Definition at line 4709 of file dbxmap.hpp.

References stm::db::set< Key, Compare, Allocator, Policy, Traits >::get_name(), and stm::db::set< Key, Compare, Allocator, Policy, Traits >::swap().

template<class Key, class Compare, class Allocator, class Policy, class Traits>
void stm::db::set< Key, Compare, Allocator, Policy, Traits >::swap ( set< Key, Compare, Allocator, Policy, Traits > &  other  )  throw () [inline]

Swap this db::set object with the db::set object other.

The method does not throw and guarantees that all valid iterators of either object stay valid.

Definition at line 4693 of file dbxmap.hpp.

References swap().

Referenced by stm::db::set< Key, Compare, Allocator, Policy, Traits >::operator=().


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

© Copyright Tom Michaelis 2002-2007

Distributed under the SysToMath Software License (See the accompanying file license.txt or a copy at www.SysToMath.com).