Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:58

0001 #include "CondFormats/Common/interface/Time.h"
0002 
0003 #include "FWCore/Utilities/interface/Exception.h"
0004 
0005 namespace cond {
0006 
0007   const cond::TimeType timeTypeList[TIMETYPE_LIST_MAX] = {runnumber, timestamp, lumiid, hash, userid};
0008 
0009   const cond::TimeType timeTypeValues[] = {runnumber, timestamp, lumiid, hash, userid};
0010 
0011   std::string const& timeTypeNames(int i) {
0012     static const std::string local[] = {"runnumber", "timestamp", "lumiid", "hash", "userid"};
0013     return local[i];
0014   }
0015 
0016   const TimeTypeSpecs timeTypeSpecs[] = {TimeTypeTraits<runnumber>::specs(),
0017                                          TimeTypeTraits<timestamp>::specs(),
0018                                          TimeTypeTraits<lumiid>::specs(),
0019                                          TimeTypeTraits<hash>::specs(),
0020                                          TimeTypeTraits<userid>::specs()};
0021 
0022   // find spec by name
0023   const TimeTypeSpecs& findSpecs(std::string const& name) {
0024     size_t i = 0;
0025     for (; i < TIMETYPE_LIST_MAX; i++)
0026       if (name == timeTypeSpecs[i].name)
0027         return timeTypeSpecs[i];
0028     throw cms::Exception("invalid timetype: " + name);
0029     return timeTypeSpecs[0];  // compiler happy
0030   }
0031 
0032 }  // namespace cond