1 #ifndef DataFormats_Common_MapOfVectors_h 2 #define DataFormats_Common_MapOfVectors_h 7 #include <boost/range/iterator_range.hpp> 8 #include <boost/iterator/iterator_facade.hpp> 10 class TestMapOfVectors;
17 template<
typename K,
typename T>
22 typedef std::map<K,std::vector<T> >
TheMap;
26 typedef std::vector<K>
Keys;
28 typedef std::vector<T>
Data;
34 typedef boost::iterator_range<data_iterator>
range;
36 typedef std::pair<K , range>
Pair;
39 :
public boost::iterator_facade<Iter,
41 boost::forward_traversal_tag >
48 explicit Iter(key_iterator
k, offset_iterator
o, std::vector<T>
const &
d )
91 for(
typename TheMap::const_iterator
p=it.begin();
p!=it.end();++
p)
92 tot += (*p).second.size();
94 for(
typename TheMap::const_iterator
p=it.begin();
p!=it.end();++
p)
111 std::pair<key_iterator,key_iterator>
p =
113 return (p.first!=p.second) ? p.first :
m_keys.end();
135 const_iterator
end()
const {
153 friend class ::TestMapOfVectors;
162 template <
typename K,
typename T>
171 #endif // DatFormats_Common_MapOfVectors_h
Iter(key_iterator k, offset_iterator o, std::vector< T > const &d)
size_type offset(K const &k) const
Keys::const_iterator key_iterator
MapOfVectors(TheMap const &it)
void loadNext(K const &k, std::vector< T > const &v)
Offsets::const_iterator offset_iterator
void swap(MapOfVectors &other)
std::map< K, std::vector< T > > TheMap
key_iterator findKey(K const &k) const
bool equal(self const &other) const
std::vector< size_type > m_offsets
const_iterator begin() const
std::pair< K, range > Pair
friend class boost::iterator_core_access
MapOfVectors & operator=(MapOfVectors const &rhs)
range find(K const &k) const
std::vector< size_type > Offsets
Data::const_iterator data_iterator
Pair const & dereference() const
const_iterator end() const
boost::iterator_range< data_iterator > range