CMS 3D CMS Logo

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 DDException is thrown More...

#include <DDReadMapType.h>

Inheritance diagram for ReadMapType< V >:
map

List of all members.

Public Member Functions

const V & operator[] (const std::string &key) const throw (DDException)
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 DDException is thrown

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

Definition at line 17 of file DDReadMapType.h.


Constructor & Destructor Documentation

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

Definition at line 20 of file DDReadMapType.h.

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

Member Function Documentation

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

Definition at line 22 of file DDReadMapType.h.

Referenced by ReadMapType< std::map< std::string, double > >::operator[]().

   { 
      typename std::map<std::string,V>::const_iterator it = this->find(key); 
      if (it == this->end()) dddDetails::errorReadMapType(key);
      return it->second;
   }
template<class V>
V& ReadMapType< V >::operator[] ( const std::string &  key) [inline]

Definition at line 30 of file DDReadMapType.h.

   {
      //std::cout << "non-const-called" << std::endl;
      return std::map<std::string,V>::operator[](key);
   }