Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:17

0001 #ifndef DQMOFFLINE_TRIGGER_EGHLTCOMCODES
0002 #define DQMOFFLINE_TRIGGER_EGHLTCOMCODES
0003 
0004 #include <cstring>
0005 #include <string>
0006 #include <vector>
0007 #include <iostream>
0008 #include <algorithm>
0009 
0010 namespace egHLT {
0011 
0012   class ComCodes {
0013   private:
0014     std::vector<std::pair<std::string, int> > _codeDefs;
0015 
0016   public:
0017     ComCodes() = default;
0018     ComCodes(const ComCodes& rhs) = default;
0019     ~ComCodes() = default;
0020 
0021     //accessors
0022     int getCode(const char* descript) const;
0023     void getCodeName(int code, std::string& id) const;
0024 
0025     //modifiers
0026     void setCode(const char* descript, int code);
0027 
0028     //key comp
0029     static bool keyComp(const std::pair<std::string, int>& lhs, const std::pair<std::string, int>& rhs);
0030     void sort() { std::sort(_codeDefs.begin(), _codeDefs.end(), keyComp); }
0031   };
0032 }  // namespace egHLT
0033 #endif