opengm::RandomAccessSet< Key, Compare, Alloc > Class Template Reference

set with O(n) insert and O(1) access More...

#include <randomaccessset.hxx>

Inheritance diagram for opengm::RandomAccessSet< Key, Compare, Alloc >:
Inheritance graph
[legend]
Collaboration diagram for opengm::RandomAccessSet< Key, Compare, Alloc >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Key key_type
 key type of the set
typedef Key ValueType
 value type of the set
typedef Key value_type
 value type of the set
typedef Compare key_compare
 comperator
typedef Compare value_compare
 value comperator
typedef Alloc allocator_type
 acclocator
typedef Alloc::const_reference const_reference
 const reference type
typedef VectorType::iterator iterator
 iterator type
typedef VectorType::const_iterator const_iterator
 const iterator type
typedef VectorType::size_type size_type
 size type
typedef VectorType::difference_type difference_type
 difference type
typedef VectorType::const_pointer const_pointer
 const pointer type
typedef
VectorType::const_reverse_iterator 
const_reverse_iterator
 const reverse iterator

Public Member Functions

 RandomAccessSet (const size_t, const Compare &compare=Compare(), const Alloc &alloc=Alloc())
 constructor
 RandomAccessSet (const Compare &compare=Compare(), const Alloc &alloc=Alloc())
 constructor
template<class InputIterator >
 RandomAccessSet (InputIterator, InputIterator, const Compare &compare=Compare(), const Alloc &alloc=Alloc())
 constructor
 RandomAccessSet (const RandomAccessSet &)
 copy constructor
RandomAccessSetoperator= (const RandomAccessSet &)
 assignment operator
const value_typeoperator[] (const size_type) const
const_iterator begin () const
 const begin iterator
const_iterator end () const
 const end iterator
const_iterator rbegin () const
 reverse const begin iterator
const_iterator rend () const
 reverse const end iterator
iterator begin ()
 begin iterator
iterator end ()
 end iterator
iterator rbegin ()
 reverse begin iterator
iterator rend ()
 reverse end iterator
bool empty () const
 query if the set is empty
size_type size () const
 number of elements of the set
size_type max_size () const
 maximum size of the underlying container
std::pair< const_iterator, boolinsert (const value_type &)
template<class InputIterator >
void insert (InputIterator, InputIterator)
 insert a sequence of elements
const_iterator insert (const_iterator, const value_type &)
void erase (iterator position)
size_type erase (const key_type &)
void erase (const_iterator, const_iterator)
void swap (RandomAccessSet &)
 swap random access sets
void clear ()
 clear the set
key_compare key_comp () const
 key comparator
value_compare value_comp () const
 value comparator
const_iterator find (const key_type &) const
iterator find (const key_type &)
size_type count (const key_type &) const
const_iterator lower_bound (const key_type &) const
const_iterator upper_bound (const key_type &) const
std::pair< const_iterator,
const_iterator
equal_range (const key_type &) const
iterator lower_bound (const key_type &)
iterator upper_bound (const key_type &)
std::pair< iterator, iteratorequal_range (const key_type &)
allocator_type get_allocator () const
 allocators
void reserve (const size_t size)
size_t capacity () const

Detailed Description

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
class opengm::RandomAccessSet< Key, Compare, Alloc >

set with O(n) insert and O(1) access

Template Parameters:
Key key and value type of the set
Alloc allocator of the set RandomAccessSet has the same interface as std::set. In addition, there is operator[].
Warning:
Values in set must not be changend through the mutable iterator because doing so would potentially change the order of the values \ingroup datastructures

Definition at line 21 of file randomaccessset.hxx.


Member Typedef Documentation

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef Alloc opengm::RandomAccessSet< Key, Compare, Alloc >::allocator_type

acclocator

Definition at line 39 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef VectorType::const_iterator opengm::RandomAccessSet< Key, Compare, Alloc >::const_iterator

const iterator type

Definition at line 45 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef VectorType::const_pointer opengm::RandomAccessSet< Key, Compare, Alloc >::const_pointer

const pointer type

Definition at line 51 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef Alloc::const_reference opengm::RandomAccessSet< Key, Compare, Alloc >::const_reference

const reference type

Definition at line 41 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef VectorType::const_reverse_iterator opengm::RandomAccessSet< Key, Compare, Alloc >::const_reverse_iterator

const reverse iterator

Definition at line 53 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef VectorType::difference_type opengm::RandomAccessSet< Key, Compare, Alloc >::difference_type

difference type

Definition at line 49 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef VectorType::iterator opengm::RandomAccessSet< Key, Compare, Alloc >::iterator

iterator type

Definition at line 43 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef Compare opengm::RandomAccessSet< Key, Compare, Alloc >::key_compare

comperator

Definition at line 35 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef Key opengm::RandomAccessSet< Key, Compare, Alloc >::key_type

key type of the set

Definition at line 29 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef VectorType::size_type opengm::RandomAccessSet< Key, Compare, Alloc >::size_type

size type

Definition at line 47 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef Compare opengm::RandomAccessSet< Key, Compare, Alloc >::value_compare

value comperator

Definition at line 37 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef Key opengm::RandomAccessSet< Key, Compare, Alloc >::value_type

value type of the set

Definition at line 33 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
typedef Key opengm::RandomAccessSet< Key, Compare, Alloc >::ValueType

value type of the set

Definition at line 31 of file randomaccessset.hxx.


Constructor & Destructor Documentation

template<class Key , class Compare, class Alloc>
opengm::RandomAccessSet< Key, Compare, Alloc >::RandomAccessSet ( const size_t  reserveSize,
const Compare &  compare = Compare(),
const Alloc &  alloc = Alloc() 
) [inline]

constructor

Parameters:
reserveSize reserve /allocate space
compare comperator
alloc allocator

Definition at line 122 of file randomaccessset.hxx.

template<class Key , class Compare, class Alloc>
opengm::RandomAccessSet< Key, Compare, Alloc >::RandomAccessSet ( const Compare &  compare = Compare(),
const Alloc &  alloc = Alloc() 
) [inline]

constructor

Parameters:
compare comperator allocator

Definition at line 151 of file randomaccessset.hxx.

template<class Key , class Compare, class Alloc>
template<class InputIterator >
opengm::RandomAccessSet< Key, Compare, Alloc >::RandomAccessSet ( InputIterator  beginInput,
InputIterator  endInput,
const Compare &  compare = Compare(),
const Alloc &  alloc = Alloc() 
) [inline]

constructor

Template Parameters:
InputIterator (key/value) input iterator
Parameters:
beginInput 
endInput 

Definition at line 167 of file randomaccessset.hxx.

template<class Key , class Compare, class Alloc>
opengm::RandomAccessSet< Key, Compare, Alloc >::RandomAccessSet ( const RandomAccessSet< Key, Compare, Alloc > &  src  )  [inline]

copy constructor

Parameters:
src other random access set

Definition at line 187 of file randomaccessset.hxx.


Member Function Documentation

template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::iterator opengm::RandomAccessSet< Key, Compare, Alloc >::begin (  )  [inline]

begin iterator

Parameters:
begin iterator

Definition at line 249 of file randomaccessset.hxx.

template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::const_iterator opengm::RandomAccessSet< Key, Compare, Alloc >::begin (  )  const [inline]

const begin iterator

Returns:
begin iterator

Definition at line 214 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
size_t opengm::RandomAccessSet< Key, Compare, Alloc >::capacity (  )  const [inline]

Definition at line 106 of file randomaccessset.hxx.

template<class Key , class Compare , class Alloc >
void opengm::RandomAccessSet< Key, Compare, Alloc >::clear (  )  [inline]

clear the set

erases all elements

Definition at line 430 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
size_type opengm::RandomAccessSet< Key, Compare, Alloc >::count ( const key_type  )  const
template<class Key , class Compare , class Alloc >
bool opengm::RandomAccessSet< Key, Compare, Alloc >::empty (  )  const [inline]

query if the set is empty

Returns:
true if empty

Definition at line 285 of file randomaccessset.hxx.

template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::iterator opengm::RandomAccessSet< Key, Compare, Alloc >::end (  )  [inline]

end iterator

Parameters:
end iterator

Definition at line 258 of file randomaccessset.hxx.

template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::const_iterator opengm::RandomAccessSet< Key, Compare, Alloc >::end (  )  const [inline]

const end iterator

Returns:
end iterator

Definition at line 223 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
std::pair<iterator,iterator> opengm::RandomAccessSet< Key, Compare, Alloc >::equal_range ( const key_type  ) 
template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
std::pair<const_iterator,const_iterator> opengm::RandomAccessSet< Key, Compare, Alloc >::equal_range ( const key_type  )  const
template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
void opengm::RandomAccessSet< Key, Compare, Alloc >::erase ( const_iterator  ,
const_iterator   
)
template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
size_type opengm::RandomAccessSet< Key, Compare, Alloc >::erase ( const key_type  ) 
template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
void opengm::RandomAccessSet< Key, Compare, Alloc >::erase ( iterator  position  ) 
template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
iterator opengm::RandomAccessSet< Key, Compare, Alloc >::find ( const key_type  ) 
template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
const_iterator opengm::RandomAccessSet< Key, Compare, Alloc >::find ( const key_type  )  const
template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::allocator_type opengm::RandomAccessSet< Key, Compare, Alloc >::get_allocator (  )  const [inline]

allocators

Returns:
allocator

Definition at line 585 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
const_iterator opengm::RandomAccessSet< Key, Compare, Alloc >::insert ( const_iterator  ,
const value_type  
)
template<class Key , class Compare , class Alloc >
template<class InputIterator >
void opengm::RandomAccessSet< Key, Compare, Alloc >::insert ( InputIterator  first,
InputIterator  last 
) [inline]

insert a sequence of elements

Parameters:
first iterator to the first element
last iterator to the last element

Definition at line 338 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
std::pair< const_iterator,bool> opengm::RandomAccessSet< Key, Compare, Alloc >::insert ( const value_type  ) 
template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::key_compare opengm::RandomAccessSet< Key, Compare, Alloc >::key_comp (  )  const [inline]

key comparator

Returns:
key comparator

Definition at line 439 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
iterator opengm::RandomAccessSet< Key, Compare, Alloc >::lower_bound ( const key_type  ) 
template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
const_iterator opengm::RandomAccessSet< Key, Compare, Alloc >::lower_bound ( const key_type  )  const
template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::size_type opengm::RandomAccessSet< Key, Compare, Alloc >::max_size (  )  const [inline]

maximum size of the underlying container

Returns:
the maximum size

Definition at line 303 of file randomaccessset.hxx.

template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc > & opengm::RandomAccessSet< Key, Compare, Alloc >::operator= ( const RandomAccessSet< Key, Compare, Alloc > &  src  )  [inline]

assignment operator

Parameters:
src other random access set

Definition at line 199 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
const value_type& opengm::RandomAccessSet< Key, Compare, Alloc >::operator[] ( const   size_type  )  const
template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::iterator opengm::RandomAccessSet< Key, Compare, Alloc >::rbegin (  )  [inline]

reverse begin iterator

Parameters:
reverse begin iterator

Definition at line 267 of file randomaccessset.hxx.

template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::const_iterator opengm::RandomAccessSet< Key, Compare, Alloc >::rbegin (  )  const [inline]

reverse const begin iterator

Returns:
reverse begin iterator

Definition at line 231 of file randomaccessset.hxx.

template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::iterator opengm::RandomAccessSet< Key, Compare, Alloc >::rend (  )  [inline]

reverse end iterator

Parameters:
reverse end iterator

Definition at line 276 of file randomaccessset.hxx.

template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::const_iterator opengm::RandomAccessSet< Key, Compare, Alloc >::rend (  )  const [inline]

reverse const end iterator

Parameters:
reverse end iterator

Definition at line 240 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
void opengm::RandomAccessSet< Key, Compare, Alloc >::reserve ( const size_t  size  )  [inline]

Definition at line 103 of file randomaccessset.hxx.

Here is the caller graph for this function:

template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::size_type opengm::RandomAccessSet< Key, Compare, Alloc >::size (  )  const [inline]

number of elements of the set

Returns:
number of elements in the set

Definition at line 294 of file randomaccessset.hxx.

template<class Key , class Compare , class Alloc >
void opengm::RandomAccessSet< Key, Compare, Alloc >::swap ( RandomAccessSet< Key, Compare, Alloc > &  rhs  )  [inline]

swap random access sets

Parameters:
rhs set to swap with

Definition at line 417 of file randomaccessset.hxx.

template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
iterator opengm::RandomAccessSet< Key, Compare, Alloc >::upper_bound ( const key_type  ) 
template<class Key, class Compare = std::less<Key>, class Alloc = std::allocator<Key>>
const_iterator opengm::RandomAccessSet< Key, Compare, Alloc >::upper_bound ( const key_type  )  const
template<class Key , class Compare , class Alloc >
RandomAccessSet< Key, Compare, Alloc >::value_compare opengm::RandomAccessSet< Key, Compare, Alloc >::value_comp (  )  const [inline]

value comparator

Returns:
value comparator

Definition at line 448 of file randomaccessset.hxx.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Jun 17 16:31:10 2013 for OpenGM by  doxygen 1.6.3