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>
15 template<
typename K,
typename T>
20 typedef std::map<K,std::vector<T> >
TheMap;
24 typedef std::vector<K>
Keys;
26 typedef std::vector<T>
Data;
32 typedef boost::iterator_range<data_iterator>
range;
34 typedef std::pair<K , range>
Pair;
37 :
public boost::iterator_facade<Iter,
39 boost::forward_traversal_tag >
59 bool equal(
self const& other)
const {
60 return this->
key == other.key;
89 for(
typename TheMap::const_iterator
p=it.begin();
p!=it.end();++
p)
90 tot += (*p).second.size();
92 for(
typename TheMap::const_iterator
p=it.begin();
p!=it.end();++
p)
109 std::pair<key_iterator,key_iterator>
p =
111 return (p.first!=p.second) ? p.first :
m_keys.end();
157 template <
typename K,
typename T>
166 #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
void swap(Association< C > &lhs, Association< C > &rhs)
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