Sierra Toolkit Version of the Day
sierra::vecset< Key, Compare > Class Template Reference

Vector-based std::set functionality. More...

#include <VecSet.hpp>

List of all members.

Public Types

typedef Key key_type
typedef Key value_type
typedef Compare key_compare
typedef Compare value_compare
const_key_type_meta_func< Key >
typedef storage::allocator_type allocator_type
typedef allocator_type::reference reference
typedef allocator_type::pointer pointer
typedef storage::size_type size_type
typedef storage::difference_type difference_type
typedef storage::iterator iterator
typedef storage::const_iterator const_iterator
typedef storage::reverse_iterator reverse_iterator

Public Member Functions

 vecset (const vecset< Key, Compare > &rhs)
vecset< Key, Compare > & operator= (const vecset< Key, Compare > &rhs)
void swap (vecset< Key, Compare > &v)
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
bool empty () const
size_type size () const
size_type max_size () const
iterator lower_bound (const_key_type &k)
const_iterator lower_bound (const_key_type &k) const
iterator upper_bound (const_key_type &k)
const_iterator upper_bound (const_key_type &k) const
std::pair< iterator, bool > insert (const value_type &v)
void erase (iterator i)
void erase (iterator first, iterator last)
size_type erase (const_key_type &k)
void clear ()
key_compare key_comp () const
value_compare value_comp () const
iterator find (const_key_type &k)
const_iterator find (const_key_type &k) const
size_type count (const_key_type &k) const
 operator const storage & () const
void reserve (size_type n)
bool operator== (const vecset< Key, Compare > &rhs) const
bool operator!= (const vecset< Key, Compare > &rhs) const

Detailed Description

template<class Key, class Compare = std::less<Key>>
class sierra::vecset< Key, Compare >

Vector-based std::set functionality.

Purpose: Mimic the 'std::set' interface

This template class mimics the 'std::set' associative container interface; however, its semantics are significantly different. Storage for the set-lite class is provided by the std::vector class where the entries are sorted by key value.

Domain of Applicability

Light weight associative container functionality for small keys and values, e.g. key = integer and value = pointer.

Associative container violations

Modifications to the vecset contents are linear complexity in violation of the associative container requirement for logarithmic complexity. Furthermore, modification operations are guaranteed to invalidate all iterators after the insert/erase point. Insertion operations may also invalidate all iterators if the storage is reallocated.

Associative container compliance

All non-modifying query operations conform to either the constant or logarithmic complexity.

Definition at line 59 of file VecSet.hpp.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines