CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
ReadMapType< V > Class Template Reference

a std::map<std::string,YourType> that offers a const operator[key]; if key is not stored in the std::map, a cms::Exception is thrown More...

#include <DDReadMapType.h>

Inheritance diagram for ReadMapType< V >:

Public Member Functions

const V & operator[] (const std::string &key) const
 
V & operator[] (const std::string &key)
 
 ReadMapType ()
 

Detailed Description

template<class V>
class ReadMapType< V >

a std::map<std::string,YourType> that offers a const operator[key]; if key is not stored in the std::map, a cms::Exception is thrown

otherwise, the ReadMapType works the same as std::map<std::string,YourType>

Definition at line 13 of file DDReadMapType.h.

Constructor & Destructor Documentation

template<class V>
ReadMapType< V >::ReadMapType ( )
inline

Definition at line 16 of file DDReadMapType.h.

16 : std::map<std::string,V>() {}

Member Function Documentation

template<class V>
const V& ReadMapType< V >::operator[] ( const std::string &  key) const
inline

Definition at line 18 of file DDReadMapType.h.

19  {
20  typename std::map<std::string,V>::const_iterator it = this->find(key);
21  if (it == this->end()) dddDetails::errorReadMapType(key);
22  return it->second;
23  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
#define end
Definition: vmac.h:37
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
void errorReadMapType(const std::string &key)
Definition: DDReadMapType.cc:5
template<class V>
V& ReadMapType< V >::operator[] ( const std::string &  key)
inline

Definition at line 25 of file DDReadMapType.h.

26  {
28  }
T operator[](int i) const
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.