#include <DataFormats/Common/interface/MapOfVectors.h>
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 (TheMap const &it) | |
MapOfVectors () | |
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 |
Classes | |
class | Iter |
Definition at line 17 of file MapOfVectors.h.
typedef Iter edm::MapOfVectors< K, T >::const_iterator |
Definition at line 78 of file MapOfVectors.h.
typedef std::vector<T> edm::MapOfVectors< K, T >::Data |
Definition at line 27 of file MapOfVectors.h.
typedef Data::const_iterator edm::MapOfVectors< K, T >::data_iterator |
Definition at line 31 of file MapOfVectors.h.
typedef Keys::const_iterator edm::MapOfVectors< K, T >::key_iterator |
Definition at line 29 of file MapOfVectors.h.
typedef std::vector<K> edm::MapOfVectors< K, T >::Keys |
Definition at line 25 of file MapOfVectors.h.
typedef Offsets::const_iterator edm::MapOfVectors< K, T >::offset_iterator |
Definition at line 30 of file MapOfVectors.h.
typedef std::vector<size_type> edm::MapOfVectors< K, T >::Offsets |
Definition at line 26 of file MapOfVectors.h.
typedef std::pair<K , range> edm::MapOfVectors< K, T >::Pair |
Definition at line 35 of file MapOfVectors.h.
typedef boost::iterator_range<data_iterator> edm::MapOfVectors< K, T >::range |
Definition at line 33 of file MapOfVectors.h.
typedef MapOfVectors<K,T> edm::MapOfVectors< K, T >::self |
Definition at line 20 of file MapOfVectors.h.
typedef unsigned int edm::MapOfVectors< K, T >::size_type |
Definition at line 23 of file MapOfVectors.h.
typedef std::map<K,std::vector<T> > edm::MapOfVectors< K, T >::TheMap |
Definition at line 21 of file MapOfVectors.h.
edm::MapOfVectors< K, T >::MapOfVectors | ( | ) | [inline] |
edm::MapOfVectors< K, T >::MapOfVectors | ( | TheMap const & | it | ) | [inline] |
Definition at line 85 of file MapOfVectors.h.
References edm::MapOfVectors< K, T >::loadNext(), edm::MapOfVectors< K, T >::m_data, edm::MapOfVectors< K, T >::m_keys, edm::MapOfVectors< K, T >::m_offsets, and p.
00085 { 00086 m_keys.reserve(it.size()); 00087 m_offsets.reserve(it.size()+1); 00088 m_offsets.push_back(0); 00089 size_type tot=0; 00090 for(typename TheMap::const_iterator p=it.begin(); p!=it.end();++p) 00091 tot += (*p).second.size(); 00092 m_data.reserve(tot); 00093 for(typename TheMap::const_iterator p=it.begin(); p!=it.end();++p) 00094 loadNext((*p).first,(*p).second); 00095 00096 }
const_iterator edm::MapOfVectors< K, T >::begin | ( | ) | const [inline] |
Definition at line 130 of file MapOfVectors.h.
References edm::MapOfVectors< K, T >::m_data, edm::MapOfVectors< K, T >::m_keys, and edm::MapOfVectors< K, T >::m_offsets.
Referenced by SiStripConfigDb::printDcuDetIds(), SiStripConfigDb::printDeviceDescriptions(), SiStripConfigDb::printFedConnections(), and SiStripConfigDb::printFedDescriptions().
00130 { 00131 return const_iterator(m_keys.begin(),m_offsets.begin(),m_data); 00132 }
bool edm::MapOfVectors< K, T >::empty | ( | ) | const [inline] |
Definition at line 107 of file MapOfVectors.h.
References edm::MapOfVectors< K, T >::m_keys.
Referenced by SiStripConfigDb::clearDcuDetIds(), SiStripConfigDb::clearDeviceDescriptions(), SiStripConfigDb::clearFedConnections(), SiStripConfigDb::clearFedDescriptions(), SiStripConfigDb::getDcuDetIds(), SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedConnections(), SiStripConfigDb::getFedDescriptions(), SiStripConfigDb::uploadDeviceDescriptions(), SiStripConfigDb::uploadFedConnections(), and SiStripConfigDb::uploadFedDescriptions().
00107 { return m_keys.empty();}
range edm::MapOfVectors< K, T >::emptyRange | ( | ) | const [inline] |
Definition at line 81 of file MapOfVectors.h.
References edm::MapOfVectors< K, T >::m_data.
Referenced by SiStripConfigDb::addDeviceDescriptions(), SiStripConfigDb::addFedConnections(), SiStripConfigDb::addFedDescriptions(), SiStripConfigDb::clearDcuDetIds(), SiStripConfigDb::clearDeviceDescriptions(), SiStripConfigDb::clearFedConnections(), SiStripConfigDb::clearFedDescriptions(), edm::MapOfVectors< K, T >::find(), SiStripConfigDb::getDcuDetIds(), SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedConnections(), SiStripConfigDb::getFedDescriptions(), SiStripConfigDb::uploadDeviceDescriptions(), SiStripConfigDb::uploadFedConnections(), and SiStripConfigDb::uploadFedDescriptions().
const_iterator edm::MapOfVectors< K, T >::end | ( | ) | const [inline] |
Definition at line 134 of file MapOfVectors.h.
References edm::MapOfVectors< K, T >::m_data, edm::MapOfVectors< K, T >::m_keys, and edm::MapOfVectors< K, T >::m_offsets.
Referenced by SiStripConfigDb::printDcuDetIds(), SiStripConfigDb::printDeviceDescriptions(), SiStripConfigDb::printFedConnections(), and SiStripConfigDb::printFedDescriptions().
00134 { 00135 return const_iterator(m_keys.end(),m_offsets.begin()+m_keys.size(),m_data); 00136 }
range edm::MapOfVectors< K, T >::find | ( | K const & | k | ) | const [inline] |
Definition at line 121 of file MapOfVectors.h.
References b, e, edm::MapOfVectors< K, T >::emptyRange(), edm::MapOfVectors< K, T >::findKey(), muonGeometry::loc, edm::MapOfVectors< K, T >::m_data, edm::MapOfVectors< K, T >::m_keys, edm::MapOfVectors< K, T >::m_offsets, and p.
Referenced by SiStripConfigDb::addDeviceDescriptions(), SiStripConfigDb::addFedConnections(), SiStripConfigDb::addFedDescriptions(), SiStripConfigDb::clearDcuDetIds(), SiStripConfigDb::clearDeviceDescriptions(), SiStripConfigDb::clearFedConnections(), SiStripConfigDb::clearFedDescriptions(), SiStripConfigDb::getDcuDetIds(), SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedConnections(), SiStripConfigDb::getFedDescriptions(), SiStripConfigDb::uploadDeviceDescriptions(), SiStripConfigDb::uploadFedConnections(), and SiStripConfigDb::uploadFedDescriptions().
00121 { 00122 key_iterator p = findKey(k); 00123 if (p==m_keys.end()) return emptyRange(); 00124 size_type loc = p-m_keys.begin(); 00125 data_iterator b = m_data.begin()+m_offsets[loc]; 00126 data_iterator e = m_data.begin()+m_offsets[loc+1]; 00127 return range(b,e); 00128 }
key_iterator edm::MapOfVectors< K, T >::findKey | ( | K const & | k | ) | const [inline] |
Definition at line 109 of file MapOfVectors.h.
References edm::MapOfVectors< K, T >::m_keys, and p.
Referenced by edm::MapOfVectors< K, T >::find(), and edm::MapOfVectors< K, T >::offset().
00109 { 00110 std::pair<key_iterator,key_iterator> p = 00111 std::equal_range(m_keys.begin(), m_keys.end(), k); 00112 return (p.first!=p.second) ? p.first : m_keys.end(); 00113 }
void edm::MapOfVectors< K, T >::loadNext | ( | K const & | k, | |
std::vector< T > const & | v | |||
) | [inline] |
Definition at line 98 of file MapOfVectors.h.
References edmNew::copy(), edm::MapOfVectors< K, T >::m_data, edm::MapOfVectors< K, T >::m_keys, and edm::MapOfVectors< K, T >::m_offsets.
Referenced by SiStripConfigDb::addDeviceDescriptions(), SiStripConfigDb::addFedConnections(), SiStripConfigDb::addFedDescriptions(), SiStripConfigDb::clearDcuDetIds(), SiStripConfigDb::clearDeviceDescriptions(), SiStripConfigDb::clearFedConnections(), SiStripConfigDb::clearFedDescriptions(), SiStripConfigDb::getDcuDetIds(), SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedConnections(), SiStripConfigDb::getFedDescriptions(), and edm::MapOfVectors< K, T >::MapOfVectors().
00098 { 00099 m_keys.push_back(k); 00100 m_data.resize(m_offsets.back()+v.size()); 00101 std::copy(v.begin(),v.end(),m_data.begin()+m_offsets.back()); 00102 m_offsets.push_back(m_data.size()); 00103 }
size_type edm::MapOfVectors< K, T >::offset | ( | K const & | k | ) | const [inline] |
Definition at line 115 of file MapOfVectors.h.
References edm::MapOfVectors< K, T >::findKey(), edm::MapOfVectors< K, T >::m_data, edm::MapOfVectors< K, T >::m_keys, edm::MapOfVectors< K, T >::m_offsets, and p.
00115 { 00116 key_iterator p = findKey(k); 00117 if (p==m_keys.end()) return m_data.size(); 00118 return m_offsets[p-m_keys.begin()]; 00119 }
MapOfVectors& edm::MapOfVectors< K, T >::operator= | ( | MapOfVectors< K, T > const & | rhs | ) | [inline] |
Definition at line 144 of file MapOfVectors.h.
References edm::MapOfVectors< K, T >::swap(), and pyDBSRunClass::temp.
00144 { 00145 MapOfVectors temp(rhs); 00146 this->swap(temp); 00147 return *this; 00148 }
size_type edm::MapOfVectors< K, T >::size | ( | void | ) | const [inline] |
Definition at line 105 of file MapOfVectors.h.
References edm::MapOfVectors< K, T >::m_keys.
Referenced by SiStripConfigDb::addDeviceDescriptions(), SiStripConfigDb::addFedConnections(), SiStripConfigDb::addFedDescriptions(), SiStripConfigDb::getDcuDetIds(), SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedConnections(), SiStripConfigDb::getFedDescriptions(), SiStripConfigDb::printDcuDetIds(), SiStripConfigDb::printDeviceDescriptions(), SiStripConfigDb::printFedConnections(), and SiStripConfigDb::printFedDescriptions().
00105 { return m_keys.size();}
void edm::MapOfVectors< K, T >::swap | ( | MapOfVectors< K, T > & | other | ) | [inline] |
Definition at line 138 of file MapOfVectors.h.
References edm::MapOfVectors< K, T >::m_data, edm::MapOfVectors< K, T >::m_keys, and edm::MapOfVectors< K, T >::m_offsets.
Referenced by edm::MapOfVectors< K, T >::operator=(), and edm::swap().
00138 { 00139 m_keys.swap(other.m_keys); 00140 m_offsets.swap(other.m_offsets); 00141 m_data.swap(other.m_data); 00142 }
std::vector<T> edm::MapOfVectors< K, T >::m_data [private] |
Definition at line 153 of file MapOfVectors.h.
Referenced by edm::MapOfVectors< K, T >::begin(), edm::MapOfVectors< K, T >::emptyRange(), edm::MapOfVectors< K, T >::end(), edm::MapOfVectors< K, T >::find(), edm::MapOfVectors< K, T >::loadNext(), edm::MapOfVectors< K, T >::MapOfVectors(), edm::MapOfVectors< K, T >::offset(), and edm::MapOfVectors< K, T >::swap().
std::vector<K> edm::MapOfVectors< K, T >::m_keys [private] |
Definition at line 151 of file MapOfVectors.h.
Referenced by edm::MapOfVectors< K, T >::begin(), edm::MapOfVectors< K, T >::empty(), edm::MapOfVectors< K, T >::end(), edm::MapOfVectors< K, T >::find(), edm::MapOfVectors< K, T >::findKey(), edm::MapOfVectors< K, T >::loadNext(), edm::MapOfVectors< K, T >::MapOfVectors(), edm::MapOfVectors< K, T >::offset(), edm::MapOfVectors< K, T >::size(), and edm::MapOfVectors< K, T >::swap().
std::vector<size_type> edm::MapOfVectors< K, T >::m_offsets [private] |
Definition at line 152 of file MapOfVectors.h.
Referenced by edm::MapOfVectors< K, T >::begin(), edm::MapOfVectors< K, T >::end(), edm::MapOfVectors< K, T >::find(), edm::MapOfVectors< K, T >::loadNext(), edm::MapOfVectors< K, T >::MapOfVectors(), edm::MapOfVectors< K, T >::offset(), and edm::MapOfVectors< K, T >::swap().