ProteoWizard
Public Types | Public Member Functions | Private Attributes
pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc > Class Template Reference

a wrapper for std::map that will behave properly with polymorphism More...

#include <virtual_map.hpp>

List of all members.

Public Types

typedef std::map< keyT, valueT,
_Pr, _Alloc > 
BaseType
typedef BaseType::allocator_type allocator_type
typedef BaseType::key_type key_type
typedef BaseType::value_type value_type
typedef BaseType::key_compare key_compare
typedef BaseType::value_compare value_compare
typedef BaseType::size_type size_type
typedef BaseType::mapped_type mapped_type
typedef BaseType::difference_type difference_type
typedef BaseType::pointer pointer
typedef BaseType::const_pointer const_pointer
typedef BaseType::reference reference
typedef BaseType::const_reference const_reference
typedef BaseType::iterator iterator
typedef BaseType::const_iterator const_iterator
typedef BaseType::reverse_iterator reverse_iterator
typedef
BaseType::const_reverse_iterator 
const_reverse_iterator

Public Member Functions

 virtual_map (const key_compare &predicate=key_compare(), const allocator_type &allocator=allocator_type())
 Constructs an empty map that uses the predicate _Pred to order keys, if it is supplied. The map uses the allocator _Alloc for all storage management, if it is supplied.
template<class _Iter >
 virtual_map (_Iter _First, _Iter _Last)
 Constructs a map containing values in the range [_First, _Last). Creation of the new map is only guaranteed to succeed if the iterators start and finish return values of type pair<class Key, class Value> and all values of Key in the range [_First, _Last) are unique. The map uses the predicate _Pred to order keys, and the allocator _Alloc for all storage management.
template<class _Iter >
 virtual_map (_Iter _First, _Iter _Last, const key_compare &_Pred)
 Constructs a map containing values in the range [_First, _Last). Creation of the new map is only guaranteed to succeed if the iterators start and finish return values of type pair<class Key, class Value> and all values of Key in the range [_First, _Last) are unique. The map uses the predicate _Pred to order keys, and the allocator _Alloc for all storage management.
template<class _Iter >
 virtual_map (_Iter _First, _Iter _Last, const key_compare &_Pred, const allocator_type &_Al)
 Constructs a map containing values in the range [_First, _Last). Creation of the new map is only guaranteed to succeed if the iterators start and finish return values of type pair<class Key, class Value> and all values of Key in the range [_First, _Last) are unique. The map uses the predicate _Pred to order keys, and the allocator _Alloc for all storage management.
virtual ~virtual_map ()
virtual allocator_type get_allocator () const
 Returns a copy of the allocator used by self for storage management.
virtual iterator begin ()
 Returns an iterator pointing to the first element stored in the map. First is defined by the map's comparison operator, Compare.
virtual const_iterator begin () const
 Returns a const_iterator pointing to the first element stored in the map.
virtual iterator end ()
 Returns an iterator pointing to the last element stored in the map; in other words, to the off-the-end value.
virtual const_iterator end () const
 Returns a const_iterator pointing to the last element stored in the map.
virtual reverse_iterator rbegin ()
 Returns a reverse_iterator pointing to the first element stored in the map. First is defined by the map's comparison operator, Compare.
virtual const_reverse_iterator rbegin () const
 Returns a const_reverse_iterator pointing to the first element stored in the map.
virtual reverse_iterator rend ()
 Returns a reverse_iterator pointing to the last element stored in the map; in other words, to the off-the-end value).
virtual const_reverse_iterator rend () const
 Returns a const_reverse_iterator pointing to the last element stored in the map.
virtual virtual_map< keyT,
valueT, key_compare,
allocator_type > & 
operator= (const virtual_map< keyT, valueT, key_compare, allocator_type > &x)
 Replaces the contents of *this with a copy of the map x.
virtual mapped_typeoperator[] (const key_type &x)
 If an element with the key x exists in the map, then a reference to its associated value is returned. Otherwise the pair x,T() is inserted into the map and a reference to the default object T() is returned.
virtual void clear ()
 Erases all elements from the self.
virtual size_type count (const key_type &x) const
 Returns a 1 if a value with the key x exists in the map. Otherwise returns a 0.
virtual bool empty () const
 Returns true if the map is empty, false otherwise.
virtual std::pair< iterator,
iterator
equal_range (const key_type &x)
 Returns the pair (lower_bound(x), upper_bound(x)).
virtual std::pair
< const_iterator,
const_iterator
equal_range (const key_type &x) const
 Returns the pair (lower_bound(x), upper_bound(x)).
virtual void erase (iterator position)
 Deletes the map element pointed to by the iterator position.
virtual void erase (iterator start, iterator finish)
 If the iterators start and finish point to the same map and last is reachable from first, all elements in the range [start, finish) are deleted from the map.
virtual size_type erase (const key_type &x)
 Deletes the element with the key value x from the map, if one exists. Returns 1 if x existed in the map, 0 otherwise.
virtual iterator find (const key_type &x)
 Searches the map for a pair with the key value x and returns an iterator to that pair if it is found. If such a pair is not found the value end() is returned.
virtual const_iterator find (const key_type &x) const
 Same as find above but returns a const_iterator.
virtual std::pair< iterator, bool > insert (const value_type &x)
 If a value_type with the same key as x is not present in the map, then x is inserted into the map. Otherwise, the pair is not inserted. A position may be supplied as a hint regarding where to do the insertion. If the insertion is done right after position, then it takes amortized constant time. Otherwise it takes O(log N) time.
virtual iterator insert (iterator position, const value_type &x)
 If a value_type with the same key as x is not present in the map, then x is inserted into the map. Otherwise, the pair is not inserted. A position may be supplied as a hint regarding where to do the insertion. If the insertion is done right after position, then it takes amortized constant time. Otherwise it takes O(log N) time.
template<class InputIterator >
void insert (InputIterator start, InputIterator finish)
 Copies of each element in the range [start, finish) that possess a unique key (one not already in the map) are inserted into the map. The iterators start and finish must return values of type pair<T1,T2>. This operation takes approximately O(N*log(size()+N)) time.
virtual key_compare key_comp () const
 Returns a function object capable of comparing key values using the comparison operation, Compare, of the current map.
virtual iterator lower_bound (const key_type &x)
 Returns a reference to the first entry with a key greater than or equal to x.
virtual const_iterator lower_bound (const key_type &x) const
 Same as lower_bound above but returns a const_iterator.
virtual size_type max_size () const
 Returns the maximum possible size of the map. This size is only constrained by the number of unique keys that can be represented by the type Key.
virtual size_type size () const
 Returns the number of elements in the map.
virtual void swap (virtual_map< keyT, valueT, key_compare, allocator_type > &x)
 Swaps the contents of the map x with the current map, *this.
virtual iterator upper_bound (const key_type &x)
 Returns an iterator for the first entry with a key greater than x.
virtual const_iterator upper_bound (const key_type &x) const
 Same as upper_bound above, but returns a const_iterator.
virtual value_compare value_comp () const
 Returns a function object capable of comparing pair<const Key, T> values using the comparison operation, Compare, of the current map. This function is identical to key_comp for sets.

Private Attributes

BaseType _base

Detailed Description

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
class pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >

a wrapper for std::map that will behave properly with polymorphism

Definition at line 38 of file virtual_map.hpp.


Member Typedef Documentation

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef std::map<keyT, valueT, _Pr, _Alloc> pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::BaseType

Definition at line 42 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::allocator_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::allocator_type

Definition at line 43 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::key_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::key_type

Definition at line 44 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::value_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::value_type

Definition at line 45 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::key_compare pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::key_compare

Definition at line 46 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::value_compare pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::value_compare

Definition at line 47 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::size_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::size_type

Definition at line 48 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::mapped_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::mapped_type

Definition at line 49 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::difference_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::difference_type

Definition at line 50 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::pointer pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::pointer

Definition at line 51 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::const_pointer pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::const_pointer

Definition at line 52 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::reference pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::reference

Definition at line 53 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::const_reference pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::const_reference

Definition at line 54 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::iterator

Definition at line 55 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::const_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::const_iterator

Definition at line 56 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::reverse_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::reverse_iterator

Definition at line 57 of file virtual_map.hpp.

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
typedef BaseType::const_reverse_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::const_reverse_iterator

Definition at line 58 of file virtual_map.hpp.


Constructor & Destructor Documentation

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::virtual_map ( const key_compare predicate = key_compare(),
const allocator_type allocator = allocator_type() 
)
inlineexplicit

Constructs an empty map that uses the predicate _Pred to order keys, if it is supplied. The map uses the allocator _Alloc for all storage management, if it is supplied.

Definition at line 66 of file virtual_map.hpp.

: _base(predicate, allocator)
{
}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
template<class _Iter >
pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::virtual_map ( _Iter  _First,
_Iter  _Last 
)
inline

Constructs a map containing values in the range [_First, _Last). Creation of the new map is only guaranteed to succeed if the iterators start and finish return values of type pair<class Key, class Value> and all values of Key in the range [_First, _Last) are unique. The map uses the predicate _Pred to order keys, and the allocator _Alloc for all storage management.

Definition at line 73 of file virtual_map.hpp.

{
for (; _First != _Last; ++_First)
this->insert(*_First);
}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
template<class _Iter >
pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::virtual_map ( _Iter  _First,
_Iter  _Last,
const key_compare _Pred 
)
inline

Constructs a map containing values in the range [_First, _Last). Creation of the new map is only guaranteed to succeed if the iterators start and finish return values of type pair<class Key, class Value> and all values of Key in the range [_First, _Last) are unique. The map uses the predicate _Pred to order keys, and the allocator _Alloc for all storage management.

Definition at line 82 of file virtual_map.hpp.

: _base(_Pred, allocator_type())
{
for (; _First != _Last; ++_First)
this->insert(*_First);
}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
template<class _Iter >
pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::virtual_map ( _Iter  _First,
_Iter  _Last,
const key_compare _Pred,
const allocator_type _Al 
)
inline

Constructs a map containing values in the range [_First, _Last). Creation of the new map is only guaranteed to succeed if the iterators start and finish return values of type pair<class Key, class Value> and all values of Key in the range [_First, _Last) are unique. The map uses the predicate _Pred to order keys, and the allocator _Alloc for all storage management.

Definition at line 91 of file virtual_map.hpp.

: _base(_Pred, _Al)
{
for (; _First != _Last; ++_First)
this->insert(*_First);
}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::~virtual_map ( )
inlinevirtual

Definition at line 98 of file virtual_map.hpp.

{}

Member Function Documentation

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual allocator_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::get_allocator ( ) const
inlinevirtual

Returns a copy of the allocator used by self for storage management.

Definition at line 101 of file virtual_map.hpp.

{return _base.get_allocator();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::begin ( )
inlinevirtual

Returns an iterator pointing to the first element stored in the map. First is defined by the map's comparison operator, Compare.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 105 of file virtual_map.hpp.

{return _base.begin();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual const_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::begin ( ) const
inlinevirtual

Returns a const_iterator pointing to the first element stored in the map.

Definition at line 109 of file virtual_map.hpp.

{return _base.begin();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::end ( )
inlinevirtual

Returns an iterator pointing to the last element stored in the map; in other words, to the off-the-end value.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 113 of file virtual_map.hpp.

{return _base.end();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual const_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::end ( ) const
inlinevirtual

Returns a const_iterator pointing to the last element stored in the map.

Definition at line 117 of file virtual_map.hpp.

{return _base.end();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual reverse_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::rbegin ( )
inlinevirtual

Returns a reverse_iterator pointing to the first element stored in the map. First is defined by the map's comparison operator, Compare.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 121 of file virtual_map.hpp.

{return _base.rbegin();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual const_reverse_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::rbegin ( ) const
inlinevirtual

Returns a const_reverse_iterator pointing to the first element stored in the map.

Definition at line 125 of file virtual_map.hpp.

{return _base.rbegin();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual reverse_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::rend ( )
inlinevirtual

Returns a reverse_iterator pointing to the last element stored in the map; in other words, to the off-the-end value).

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 129 of file virtual_map.hpp.

{return _base.rend();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual const_reverse_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::rend ( ) const
inlinevirtual

Returns a const_reverse_iterator pointing to the last element stored in the map.

Definition at line 133 of file virtual_map.hpp.

{return _base.rend();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual virtual_map<keyT, valueT, key_compare, allocator_type>& pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::operator= ( const virtual_map< keyT, valueT, key_compare, allocator_type > &  x)
inlinevirtual

Replaces the contents of *this with a copy of the map x.

Definition at line 137 of file virtual_map.hpp.

{_base = x._base; return *this;}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual mapped_type& pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::operator[] ( const key_type x)
inlinevirtual

If an element with the key x exists in the map, then a reference to its associated value is returned. Otherwise the pair x,T() is inserted into the map and a reference to the default object T() is returned.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 141 of file virtual_map.hpp.

{return _base[x];}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual void pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::clear ( )
inlinevirtual

Erases all elements from the self.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 145 of file virtual_map.hpp.

{_base.clear();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual size_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::count ( const key_type x) const
inlinevirtual

Returns a 1 if a value with the key x exists in the map. Otherwise returns a 0.

Definition at line 149 of file virtual_map.hpp.

Referenced by testConversion().

{return _base.count(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual bool pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::empty ( ) const
inlinevirtual

Returns true if the map is empty, false otherwise.

Definition at line 153 of file virtual_map.hpp.

Referenced by pwiz::tradata::TextWriter::operator()(), and operatorTest().

{return _base.empty();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual std::pair<iterator, iterator> pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::equal_range ( const key_type x)
inlinevirtual

Returns the pair (lower_bound(x), upper_bound(x)).

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 157 of file virtual_map.hpp.

{return _base.equal_range(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual std::pair<const_iterator,const_iterator> pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::equal_range ( const key_type x) const
inlinevirtual

Returns the pair (lower_bound(x), upper_bound(x)).

Definition at line 161 of file virtual_map.hpp.

{return _base.equal_range(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual void pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::erase ( iterator  position)
inlinevirtual

Deletes the map element pointed to by the iterator position.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 165 of file virtual_map.hpp.

{_base.erase(position);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual void pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::erase ( iterator  start,
iterator  finish 
)
inlinevirtual

If the iterators start and finish point to the same map and last is reachable from first, all elements in the range [start, finish) are deleted from the map.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 169 of file virtual_map.hpp.

{_base.erase(start, finish);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual size_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::erase ( const key_type x)
inlinevirtual

Deletes the element with the key value x from the map, if one exists. Returns 1 if x existed in the map, 0 otherwise.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 173 of file virtual_map.hpp.

{return _base.erase(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::find ( const key_type x)
inlinevirtual

Searches the map for a pair with the key value x and returns an iterator to that pair if it is found. If such a pair is not found the value end() is returned.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 177 of file virtual_map.hpp.

{return _base.find(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual const_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::find ( const key_type x) const
inlinevirtual

Same as find above but returns a const_iterator.

Definition at line 181 of file virtual_map.hpp.

{return _base.find(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual std::pair<iterator, bool> pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::insert ( const value_type x)
inlinevirtual

If a value_type with the same key as x is not present in the map, then x is inserted into the map. Otherwise, the pair is not inserted. A position may be supplied as a hint regarding where to do the insertion. If the insertion is done right after position, then it takes amortized constant time. Otherwise it takes O(log N) time.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 185 of file virtual_map.hpp.

Referenced by pwiz::util::virtual_map< int, ModificationList >::virtual_map().

{return _base.insert(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::insert ( iterator  position,
const value_type x 
)
inlinevirtual

If a value_type with the same key as x is not present in the map, then x is inserted into the map. Otherwise, the pair is not inserted. A position may be supplied as a hint regarding where to do the insertion. If the insertion is done right after position, then it takes amortized constant time. Otherwise it takes O(log N) time.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 189 of file virtual_map.hpp.

{return _base.insert(position, x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
template<class InputIterator >
void pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::insert ( InputIterator  start,
InputIterator  finish 
)
inline

Copies of each element in the range [start, finish) that possess a unique key (one not already in the map) are inserted into the map. The iterators start and finish must return values of type pair<T1,T2>. This operation takes approximately O(N*log(size()+N)) time.

Definition at line 194 of file virtual_map.hpp.

{_base.insert(start, finish);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual key_compare pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::key_comp ( ) const
inlinevirtual

Returns a function object capable of comparing key values using the comparison operation, Compare, of the current map.

Definition at line 198 of file virtual_map.hpp.

{return _base.key_comp();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::lower_bound ( const key_type x)
inlinevirtual

Returns a reference to the first entry with a key greater than or equal to x.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 202 of file virtual_map.hpp.

{return _base.lower_bound(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual const_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::lower_bound ( const key_type x) const
inlinevirtual

Same as lower_bound above but returns a const_iterator.

Definition at line 206 of file virtual_map.hpp.

{return _base.lower_bound(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual size_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::max_size ( ) const
inlinevirtual

Returns the maximum possible size of the map. This size is only constrained by the number of unique keys that can be represented by the type Key.

Definition at line 210 of file virtual_map.hpp.

{return _base.max_size();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual size_type pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::size ( ) const
inlinevirtual

Returns the number of elements in the map.

Definition at line 214 of file virtual_map.hpp.

Referenced by testConversion().

{return _base.size();}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual void pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::swap ( virtual_map< keyT, valueT, key_compare, allocator_type > &  x)
inlinevirtual

Swaps the contents of the map x with the current map, *this.

Definition at line 218 of file virtual_map.hpp.

{_base.swap(x._base);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::upper_bound ( const key_type x)
inlinevirtual

Returns an iterator for the first entry with a key greater than x.

Reimplemented in pwiz::proteome::ModificationMap.

Definition at line 222 of file virtual_map.hpp.

{return _base.upper_bound(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual const_iterator pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::upper_bound ( const key_type x) const
inlinevirtual

Same as upper_bound above, but returns a const_iterator.

Definition at line 226 of file virtual_map.hpp.

{return _base.upper_bound(x);}
template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
virtual value_compare pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::value_comp ( ) const
inlinevirtual

Returns a function object capable of comparing pair<const Key, T> values using the comparison operation, Compare, of the current map. This function is identical to key_comp for sets.

Definition at line 230 of file virtual_map.hpp.

{return _base.value_comp();}

Member Data Documentation

template<class keyT, class valueT, class _Pr = std::less<keyT>, class _Alloc = std::allocator<std::pair<const keyT, valueT> >>
BaseType pwiz::util::virtual_map< keyT, valueT, _Pr, _Alloc >::_base
private

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