CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HcalL1TriggerObjects.h
Go to the documentation of this file.
1 #ifndef HcalL1TriggerObjects_h
2 #define HcalL1TriggerObjects_h
3 
5 
6 #include <cstring>
7 #include <string>
8 
11 
13 
14 class HcalL1TriggerObjects : public HcalCondObjectContainer<HcalL1TriggerObject> {
15 public:
16 #ifndef HCAL_COND_SUPPRESS_DEFAULT
18 #endif
20 
21  //fill the chars and read them
22  void setTagString(std::string const& fTag) {
23  std::size_t maxCharacters = charArraySize - 1;
24  if (fTag.size() > maxCharacters) {
25  throw cms::Exception("HcalL1TriggerObjects::setTagString: string exceeds array size");
26  }
27  strncpy(mTag, fTag.c_str(), maxCharacters);
28  mTag[maxCharacters] = '\0';
29  }
30 
31  void setAlgoString(std::string const& fAlgo) {
32  std::size_t maxCharacters = charArraySize - 1;
33  if (fAlgo.size() > maxCharacters) {
34  throw cms::Exception("HcalL1TriggerObjects::setAlgoString: string exceeds array size");
35  }
36  strncpy(mAlgo, fAlgo.c_str(), maxCharacters);
37  mAlgo[maxCharacters] = '\0';
38  }
39 
40  std::string getTagString() const { return mTag; }
41  std::string getAlgoString() const { return mAlgo; }
42  std::string myname() const override { return "HcalL1TriggerObjects"; }
43 
44 private:
45  static constexpr std::size_t charArraySize = 128;
48 
50 };
51 #endif
char mTag[charArraySize]
static constexpr std::size_t charArraySize
HcalL1TriggerObjects(const HcalTopology *topo)
std::string getTagString() const
std::string myname() const override
std::string getAlgoString() const
#define COND_SERIALIZABLE
Definition: Serializable.h:39
void setTagString(std::string const &fTag)
char mAlgo[charArraySize]
void setAlgoString(std::string const &fAlgo)
const HcalTopology * topo() const