#include <MapOfVectors.h>
Classes | |
class | Iter |
Public Types | |
typedef Iter | const_iterator |
typedef std::vector< T > | Data |
typedef Data::const_iterator | data_iterator |
typedef Keys::const_iterator | key_iterator |
typedef std::vector< K > | Keys |
typedef Offsets::const_iterator | offset_iterator |
typedef std::vector< size_type > | Offsets |
typedef std::pair< K, range > | Pair |
typedef boost::iterator_range < data_iterator > | range |
typedef MapOfVectors< K, T > | self |
typedef unsigned int | size_type |
typedef std::map< K, std::vector< T > > | TheMap |
Public Member Functions | |
const_iterator | begin () const |
bool | empty () const |
range | emptyRange () const |
const_iterator | end () const |
range | find (K const &k) const |
key_iterator | findKey (K const &k) const |
void | loadNext (K const &k, std::vector< T > const &v) |
MapOfVectors () | |
MapOfVectors (TheMap const &it) | |
size_type | offset (K const &k) const |
MapOfVectors & | operator= (MapOfVectors const &rhs) |
size_type | size () const |
void | swap (MapOfVectors &other) |
Private Attributes | |
std::vector< T > | m_data |
std::vector< K > | m_keys |
std::vector< size_type > | m_offsets |
Definition at line 16 of file MapOfVectors.h.
typedef Iter edm::MapOfVectors< K, T >::const_iterator |
Definition at line 77 of file MapOfVectors.h.
typedef std::vector<T> edm::MapOfVectors< K, T >::Data |
Definition at line 26 of file MapOfVectors.h.
typedef Data::const_iterator edm::MapOfVectors< K, T >::data_iterator |
Definition at line 30 of file MapOfVectors.h.
typedef Keys::const_iterator edm::MapOfVectors< K, T >::key_iterator |
Definition at line 28 of file MapOfVectors.h.
typedef std::vector<K> edm::MapOfVectors< K, T >::Keys |
Definition at line 24 of file MapOfVectors.h.
typedef Offsets::const_iterator edm::MapOfVectors< K, T >::offset_iterator |
Definition at line 29 of file MapOfVectors.h.
typedef std::vector<size_type> edm::MapOfVectors< K, T >::Offsets |
Definition at line 25 of file MapOfVectors.h.
typedef std::pair<K , range> edm::MapOfVectors< K, T >::Pair |
Definition at line 34 of file MapOfVectors.h.
typedef boost::iterator_range<data_iterator> edm::MapOfVectors< K, T >::range |
Definition at line 32 of file MapOfVectors.h.
typedef MapOfVectors<K,T> edm::MapOfVectors< K, T >::self |
Definition at line 19 of file MapOfVectors.h.
typedef unsigned int edm::MapOfVectors< K, T >::size_type |
Definition at line 22 of file MapOfVectors.h.
typedef std::map<K,std::vector<T> > edm::MapOfVectors< K, T >::TheMap |
Definition at line 20 of file MapOfVectors.h.
edm::MapOfVectors< K, T >::MapOfVectors | ( | ) | [inline] |
Definition at line 82 of file MapOfVectors.h.
: m_offsets(1,0) {}
edm::MapOfVectors< K, T >::MapOfVectors | ( | TheMap const & | it | ) | [inline] |
Definition at line 84 of file MapOfVectors.h.
{ m_keys.reserve(it.size()); m_offsets.reserve(it.size()+1); m_offsets.push_back(0); size_type tot=0; for(typename TheMap::const_iterator p=it.begin(); p!=it.end();++p) tot += (*p).second.size(); m_data.reserve(tot); for(typename TheMap::const_iterator p=it.begin(); p!=it.end();++p) loadNext((*p).first,(*p).second); }
const_iterator edm::MapOfVectors< K, T >::begin | ( | void | ) | const [inline] |
Definition at line 129 of file MapOfVectors.h.
{ return const_iterator(m_keys.begin(),m_offsets.begin(),m_data); }
bool edm::MapOfVectors< K, T >::empty | ( | ) | const [inline] |
Definition at line 106 of file MapOfVectors.h.
{ return m_keys.empty();}
range edm::MapOfVectors< K, T >::emptyRange | ( | ) | const [inline] |
Definition at line 80 of file MapOfVectors.h.
Referenced by edm::MapOfVectors< std::string, AnalysisDescription * >::find().
const_iterator edm::MapOfVectors< K, T >::end | ( | void | ) | const [inline] |
Definition at line 133 of file MapOfVectors.h.
{ return const_iterator(m_keys.end(),m_offsets.begin()+m_keys.size(),m_data); }
range edm::MapOfVectors< K, T >::find | ( | K const & | k | ) | const [inline] |
Definition at line 120 of file MapOfVectors.h.
{ key_iterator p = findKey(k); if (p==m_keys.end()) return emptyRange(); size_type loc = p-m_keys.begin(); data_iterator b = m_data.begin()+m_offsets[loc]; data_iterator e = m_data.begin()+m_offsets[loc+1]; return range(b,e); }
key_iterator edm::MapOfVectors< K, T >::findKey | ( | K const & | k | ) | const [inline] |
Definition at line 108 of file MapOfVectors.h.
Referenced by edm::MapOfVectors< std::string, AnalysisDescription * >::find(), and edm::MapOfVectors< std::string, AnalysisDescription * >::offset().
void edm::MapOfVectors< K, T >::loadNext | ( | K const & | k, |
std::vector< T > const & | v | ||
) | [inline] |
Definition at line 97 of file MapOfVectors.h.
Referenced by SiStripConfigDb::clearAnalysisDescriptions(), SiStripConfigDb::clearDcuDetIds(), SiStripConfigDb::clearDeviceDescriptions(), SiStripConfigDb::clearFedConnections(), SiStripConfigDb::clearFedDescriptions(), and edm::MapOfVectors< std::string, AnalysisDescription * >::MapOfVectors().
size_type edm::MapOfVectors< K, T >::offset | ( | K const & | k | ) | const [inline] |
Definition at line 114 of file MapOfVectors.h.
MapOfVectors& edm::MapOfVectors< K, T >::operator= | ( | MapOfVectors< K, T > const & | rhs | ) | [inline] |
Definition at line 143 of file MapOfVectors.h.
{ MapOfVectors temp(rhs); this->swap(temp); return *this; }
size_type edm::MapOfVectors< K, T >::size | ( | void | ) | const [inline] |
Definition at line 104 of file MapOfVectors.h.
{ return m_keys.size();}
void edm::MapOfVectors< K, T >::swap | ( | MapOfVectors< K, T > & | other | ) | [inline] |
Definition at line 137 of file MapOfVectors.h.
Referenced by edm::MapOfVectors< std::string, AnalysisDescription * >::operator=(), and edm::swap().
std::vector<T> edm::MapOfVectors< K, T >::m_data [private] |
Definition at line 152 of file MapOfVectors.h.
Referenced by edm::MapOfVectors< std::string, AnalysisDescription * >::begin(), edm::MapOfVectors< std::string, AnalysisDescription * >::emptyRange(), edm::MapOfVectors< std::string, AnalysisDescription * >::end(), edm::MapOfVectors< std::string, AnalysisDescription * >::find(), edm::MapOfVectors< std::string, AnalysisDescription * >::loadNext(), edm::MapOfVectors< std::string, AnalysisDescription * >::MapOfVectors(), edm::MapOfVectors< std::string, AnalysisDescription * >::offset(), and edm::MapOfVectors< std::string, AnalysisDescription * >::swap().
std::vector<K> edm::MapOfVectors< K, T >::m_keys [private] |
Definition at line 150 of file MapOfVectors.h.
Referenced by edm::MapOfVectors< std::string, AnalysisDescription * >::begin(), edm::MapOfVectors< std::string, AnalysisDescription * >::empty(), edm::MapOfVectors< std::string, AnalysisDescription * >::end(), edm::MapOfVectors< std::string, AnalysisDescription * >::find(), edm::MapOfVectors< std::string, AnalysisDescription * >::findKey(), edm::MapOfVectors< std::string, AnalysisDescription * >::loadNext(), edm::MapOfVectors< std::string, AnalysisDescription * >::MapOfVectors(), edm::MapOfVectors< std::string, AnalysisDescription * >::offset(), edm::MapOfVectors< std::string, AnalysisDescription * >::size(), and edm::MapOfVectors< std::string, AnalysisDescription * >::swap().
std::vector<size_type> edm::MapOfVectors< K, T >::m_offsets [private] |
Definition at line 151 of file MapOfVectors.h.
Referenced by edm::MapOfVectors< std::string, AnalysisDescription * >::begin(), edm::MapOfVectors< std::string, AnalysisDescription * >::end(), edm::MapOfVectors< std::string, AnalysisDescription * >::find(), edm::MapOfVectors< std::string, AnalysisDescription * >::loadNext(), edm::MapOfVectors< std::string, AnalysisDescription * >::MapOfVectors(), edm::MapOfVectors< std::string, AnalysisDescription * >::offset(), and edm::MapOfVectors< std::string, AnalysisDescription * >::swap().