CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CondFormats/Common/src/Time.cc

Go to the documentation of this file.
00001 #include "CondFormats/Common/interface/Time.h"
00002 
00003 
00004 
00005 #include "FWCore/Utilities/interface/Exception.h"
00006 
00007 namespace cond{
00008 
00009   const cond::TimeType timeTypeList[TIMETYPE_LIST_MAX]=
00010     {runnumber,timestamp,lumiid,hash,userid};
00011   
00012   const cond::TimeType timeTypeValues[]=
00013     {runnumber,timestamp,lumiid,hash,userid};
00014   
00015   std::string const & timeTypeNames(int i) {
00016     static const std::string local[]=
00017       {"runnumber","timestamp","lumiid","hash","userid"};
00018     return local[i];
00019   }
00020 
00021   
00022   const TimeTypeSpecs timeTypeSpecs[] = {
00023     TimeTypeTraits<runnumber>::specs(),
00024     TimeTypeTraits<timestamp>::specs(),
00025     TimeTypeTraits<lumiid>::specs(),
00026     TimeTypeTraits<hash>::specs(),
00027     TimeTypeTraits<userid>::specs()
00028   };
00029   
00030   
00031   
00032   // find spec by name
00033   const TimeTypeSpecs & findSpecs(std::string const & name) {
00034     size_t i=0;
00035     for (; i<TIMETYPE_LIST_MAX; i++)
00036       if (name==timeTypeSpecs[i].name) return timeTypeSpecs[i];
00037     throw cms::Exception("invalid timetype: "+name);
00038     return timeTypeSpecs[0]; // compiler happy
00039   }
00040 
00041 }