25 #ifndef _VIRTUAL_MAP_HPP_ 26 #define _VIRTUAL_MAP_HPP_ 36 class _Pr = std::less<keyT>,
37 class _Alloc = std::allocator<std::pair<const keyT, valueT> > >
42 typedef std::map<keyT, valueT, _Pr, _Alloc>
BaseType;
51 typedef typename BaseType::pointer
pointer;
67 : _base(predicate, allocator)
74 : _base(key_compare(), allocator_type())
76 for (; _First != _Last; ++_First)
82 virtual_map(_Iter _First, _Iter _Last,
const key_compare& _Pred)
83 : _base(_Pred, allocator_type())
85 for (; _First != _Last; ++_First)
91 virtual_map(_Iter _First, _Iter _Last,
const key_compare& _Pred,
const allocator_type& _Al)
94 for (; _First != _Last; ++_First)
102 {
return _base.get_allocator();}
106 {
return _base.begin();}
109 virtual const_iterator
begin()
const 110 {
return _base.begin();}
114 {
return _base.end();}
117 virtual const_iterator
end()
const 118 {
return _base.end();}
122 {
return _base.rbegin();}
125 virtual const_reverse_iterator
rbegin()
const 126 {
return _base.rbegin();}
129 virtual reverse_iterator
rend()
130 {
return _base.rend();}
133 virtual const_reverse_iterator
rend()
const 134 {
return _base.rend();}
138 {_base = x.
_base;
return *
this;}
149 virtual size_type
count(
const key_type&
x)
const 150 {
return _base.count(x);}
154 {
return _base.empty();}
158 {
return _base.equal_range(x);}
161 virtual std::pair<const_iterator,const_iterator>
equal_range(
const key_type&
x)
const 162 {
return _base.equal_range(x);}
166 {_base.erase(position);}
169 virtual void erase(iterator start, iterator finish)
170 {_base.erase(start, finish);}
173 virtual size_type
erase(
const key_type&
x)
174 {
return _base.erase(x);}
177 virtual iterator
find(
const key_type&
x)
178 {
return _base.find(x);}
181 virtual const_iterator
find(
const key_type&
x)
const 182 {
return _base.find(x);}
185 virtual std::pair<iterator, bool>
insert(
const value_type&
x)
186 {
return _base.insert(x);}
190 {
return _base.insert(position, x);}
193 template <
class InputIterator>
194 void insert(InputIterator start, InputIterator finish)
195 {_base.insert(start, finish);}
199 {
return _base.key_comp();}
203 {
return _base.lower_bound(x);}
207 {
return _base.lower_bound(x);}
211 {
return _base.max_size();}
215 {
return _base.size();}
219 {_base.swap(x.
_base);}
223 {
return _base.upper_bound(x);}
227 {
return _base.upper_bound(x);}
231 {
return _base.value_comp();}
238 #endif // _VIRTUAL_MAP_HPP_
BaseType::pointer pointer
virtual const_reverse_iterator rend() const
Returns a const_reverse_iterator pointing to the last element stored in the map.
virtual bool empty() const
Returns true if the map is empty, false otherwise.
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...
BaseType::value_compare value_compare
BaseType::mapped_type mapped_type
BaseType::size_type size_type
BaseType::reference reference
BaseType::const_pointer const_pointer
BaseType::difference_type difference_type
virtual std::pair< iterator, iterator > equal_range(const key_type &x)
Returns the pair (lower_bound(x), upper_bound(x)).
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 guar...
virtual reverse_iterator rbegin()
Returns a reverse_iterator pointing to the first element stored in the map. First is defined by the m...
virtual void erase(iterator position)
Deletes the map element pointed to by the iterator position.
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.
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.
BaseType::key_type key_type
BaseType::const_iterator const_iterator
virtual std::pair< const_iterator, const_iterator > equal_range(const key_type &x) const
Returns the pair (lower_bound(x), upper_bound(x)).
virtual const_iterator find(const key_type &x) const
Same as find above but returns a const_iterator.
virtual void erase(iterator start, iterator finish)
If the iterators start and finish point to the same map and last is reachable from first...
virtual const_iterator begin() const
Returns a const_iterator pointing to the first element stored in the map.
BaseType::const_reference const_reference
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 const_reverse_iterator rbegin() const
Returns a const_reverse_iterator pointing to the first element stored in the map. ...
BaseType::key_compare key_compare
BaseType::allocator_type allocator_type
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 m...
virtual const_iterator lower_bound(const key_type &x) const
Same as lower_bound above but returns a const_iterator.
virtual key_compare key_comp() const
Returns a function object capable of comparing key values using the comparison operation, Compare, of the current map.
BaseType::reverse_iterator reverse_iterator
std::map< keyT, valueT, _Pr, _Alloc > BaseType
BaseType::value_type value_type
virtual void clear()
Erases all elements from the self.
virtual_map(_Iter _First, _Iter _Last)
Constructs a map containing values in the range [_First, _Last). Creation of the new map is only guar...
PWIZ_API_DECL Position position(CVID cvid=CVID_Unknown)
returns a Position corresponding to one of the following CVIDs: CVID_Unknown: Position::Anywhere MS_m...
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...
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 size_type size() const
Returns the number of elements in the map.
virtual size_type max_size() const
Returns the maximum possible size of the map. This size is only constrained by the number of unique k...
virtual mapped_type & operator[](const key_type &x)
If an element with the key x exists in the map, then a reference to its associated value is returned...
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...
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...
a wrapper for std::map that will behave properly with polymorphism
BaseType::iterator iterator
virtual reverse_iterator rend()
Returns a reverse_iterator pointing to the last element stored in the map; in other words...
virtual allocator_type get_allocator() const
Returns a copy of the allocator used by self for storage management.
KernelTraitsBase< Kernel >::space_type::abscissa_type x
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 value_compare value_comp() const
Returns a function object capable of comparing pair<const Key, T> values using the comparison operati...
BaseType::const_reverse_iterator const_reverse_iterator
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 void swap(virtual_map< keyT, valueT, key_compare, allocator_type > &x)
Swaps the contents of the map x with the current map, *this.
virtual const_iterator end() const
Returns a const_iterator pointing to the last element stored in the map.
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 guar...
virtual iterator begin()
Returns an iterator pointing to the first element stored in the map. First is defined by the map's co...