CMS 3D CMS Logo

EgHLTComCodes.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_TRIGGER_EGHLTCOMCODES
2 #define DQMOFFLINE_TRIGGER_EGHLTCOMCODES
3 
4 #include <cstring>
5 #include <string>
6 #include <vector>
7 #include <iostream>
8 #include <algorithm>
9 
10 namespace egHLT {
11 
12  class ComCodes {
13  private:
14  std::vector<std::pair<std::string, int> > _codeDefs;
15 
16  public:
17  ComCodes() = default;
18  ComCodes(const ComCodes& rhs) = default;
19  ~ComCodes() = default;
20 
21  //accessors
22  int getCode(const char* descript) const;
23  void getCodeName(int code, std::string& id) const;
24 
25  //modifiers
26  void setCode(const char* descript, int code);
27 
28  //key comp
29  static bool keyComp(const std::pair<std::string, int>& lhs, const std::pair<std::string, int>& rhs);
30  void sort() { std::sort(_codeDefs.begin(), _codeDefs.end(), keyComp); }
31  };
32 } // namespace egHLT
33 #endif
egHLT::ComCodes::_codeDefs
std::vector< std::pair< std::string, int > > _codeDefs
Definition: EgHLTComCodes.h:14
egHLT::ComCodes::getCodeName
void getCodeName(int code, std::string &id) const
Definition: EgHLTComCodes.cc:48
egHLT::ComCodes::~ComCodes
~ComCodes()=default
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
egHLT::ComCodes::keyComp
static bool keyComp(const std::pair< std::string, int > &lhs, const std::pair< std::string, int > &rhs)
Definition: EgHLTComCodes.cc:44
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
egHLT::ComCodes::ComCodes
ComCodes()=default
egHLT::ComCodes::sort
void sort()
Definition: EgHLTComCodes.h:30
egHLT::ComCodes::getCode
int getCode(const char *descript) const
Definition: EgHLTComCodes.cc:19
egHLT
Definition: EgHLTBinData.h:10
egHLT::ComCodes
Definition: EgHLTComCodes.h:12
egHLT::ComCodes::setCode
void setCode(const char *descript, int code)
Definition: EgHLTComCodes.cc:7