CMS 3D CMS Logo

CaloTSamplesBase.h
Go to the documentation of this file.
1 #ifndef CALOTSAMPLESBASE_H
2 #define CALOTSAMPLESBASE_H 1
3 
5 #include <cassert>
6 #include <ostream>
7 
8 template <class Ttype>
10 public:
11  CaloTSamplesBase(Ttype *mydata, uint32_t size);
12 
14 
15  CaloTSamplesBase(Ttype *mydata, uint32_t length, const DetId &id, uint32_t size, uint32_t pre);
16 
17  virtual ~CaloTSamplesBase();
18 
19  void setZero();
20 
21  DetId id() const;
22  uint32_t size() const;
23  uint32_t pre() const;
24  bool zero() const;
25 
26  Ttype &operator[](uint32_t i);
27 
28  const Ttype &operator[](uint32_t i) const;
29 
31 
33 
35 
37 
38  virtual uint32_t capacity() const = 0;
39 
40 private:
41  virtual Ttype *data(uint32_t i) = 0;
42  virtual const Ttype *cdata(uint32_t i) const = 0;
43 
45  uint32_t m_size;
46  uint32_t m_pre;
47 };
48 
49 template <class Ttype>
50 std::ostream &operator<<(std::ostream &s, const CaloTSamplesBase<Ttype> &sam);
51 
52 #endif
virtual ~CaloTSamplesBase()
virtual uint32_t capacity() const =0
virtual const Ttype * cdata(uint32_t i) const =0
DetId id() const
CaloTSamplesBase< Ttype > & operator=(const CaloTSamplesBase< Ttype > &cs)
Definition: value.py:1
CaloTSamplesBase< Ttype > & operator*=(Ttype value)
CaloTSamplesBase(Ttype *mydata, uint32_t size)
Definition: DetId.h:17
Ttype & operator[](uint32_t i)
uint32_t pre() const
bool zero() const
CaloTSamplesBase< Ttype > & operator+=(Ttype value)
virtual Ttype * data(uint32_t i)=0
uint32_t size() const