CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OOTPileupCorrectionBuffer.h
Go to the documentation of this file.
1 #ifndef CondFormats_HcalObjects_OOTPileupCorrectionBuffer_h
2 #define CondFormats_HcalObjects_OOTPileupCorrectionBuffer_h
3 
4 //
5 // A simple storage buffer for Hcal OOT pileup corrections.
6 //
7 // I. Volobouev, 08/29/2014
8 //
9 
11 
12 #include <string>
13 
15 {
16 public:
17  // Constructors
19  inline explicit OOTPileupCorrectionBuffer(const std::string& s)
20  : m_buffer(s) {}
21  inline OOTPileupCorrectionBuffer(const char* c, std::size_t len)
22  : m_buffer(c, len) {}
23  inline explicit OOTPileupCorrectionBuffer(std::size_t len)
24  : m_buffer(len, '\0') {}
25 
26  // Inspectors
27  inline const std::string& str() const {return m_buffer;}
28  inline std::size_t length() const {return m_buffer.size();}
29  inline bool empty() const {return m_buffer.empty();}
30  inline const char* getBuffer() const
31  {return m_buffer.empty() ? static_cast<const char*>(0) : &m_buffer[0];}
32 
33  // Modifiers
34  inline char* getBuffer()
35  {return m_buffer.empty() ? static_cast<char*>(0) : &m_buffer[0];}
36  inline void setStr(const std::string& s) {m_buffer = s;}
37 
38 private:
40 
42 };
43 
44 #endif // CondFormats_HcalObjects_OOTPileupCorrectionBuffer_h
const std::string & str() const
OOTPileupCorrectionBuffer(const std::string &s)
void setStr(const std::string &s)
OOTPileupCorrectionBuffer(const char *c, std::size_t len)
#define COND_SERIALIZABLE
Definition: Serializable.h:37