CMS 3D CMS Logo

TransientDataFrame.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_TransientDataFrame_h
2 #define DataFormats_Common_TransientDataFrame_h
3 
5 #include <algorithm>
6 
7 namespace edm {
8 
9  /* a fixed size array of 16bit words belonging to
10  * a "channel" identified by an 32bit id
11  *
12  * FIXME interface to be finalized once use-cases fully identified
13  *
14  */
15  template<unsigned int SIZE>
17  public:
18 
21 
23  TransientDataFrame( id_type i) : m_id(i) {}
24  TransientDataFrame(DataFrame const & iframe) :
25  m_id(iframe.id())
26  {
27  data_type const * p = iframe.begin();
28  std::copy(p,p+SIZE,m_data);
29  }
30 
31  int size() const { return SIZE;}
32 
33  data_type operator[](size_t i) const {
34  return m_data[i];
35  }
36 
37  data_type & operator[](size_t i) {
38  return m_data[i];
39  }
40 
41  id_type id() const { return m_id; }
42 
43  private:
44  id_type m_id;
45  data_type m_data[SIZE];
46 
47  };
48 
49 }
50 
51 #endif // DataFormats_Common_TransientDataFrame_h
unsigned int id_type
Definition: DataFrame.h:19
DataFrame::data_type data_type
def copy(args, dbName)
TransientDataFrame(DataFrame const &iframe)
data_type operator[](size_t i) const
unsigned short data_type
Definition: DataFrame.h:20
iterator begin()
Definition: DataFrame.h:48
data_type & operator[](size_t i)
HLT enums.
DataFrame::id_type id_type