CMS 3D CMS Logo

DataFrame.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_DataFrame_h
2 #define DataFormats_Common_DataFrame_h
3 
4 class TestDataFrame;
5 namespace edm {
6 
7  class DataFrameContainer;
8 
9  /* a proxy to 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  class DataFrame {
16  public:
17  typedef unsigned int size_type; // for persistency
18  typedef unsigned int id_type;
19  typedef unsigned short data_type;
20  typedef data_type *iterator;
21  typedef data_type const *const_iterator;
22 
23  constexpr inline DataFrame() : m_id(0), m_data(nullptr), m_size(0) {}
24  constexpr inline DataFrame(id_type i, data_type const *idata, size_type isize)
25  : m_id(i), m_data(idata), m_size(isize) {}
26 
27  inline DataFrame(DataFrameContainer const &icont, size_type i);
28  inline void set(DataFrameContainer const &icont, size_type i);
29  constexpr inline data_type &operator[](size_type i) { return data()[i]; }
30 
31  constexpr inline data_type operator[](size_type i) const { return m_data[i]; }
32 
33  constexpr inline iterator begin() { return data(); }
34 
35  constexpr inline iterator end() { return data() + m_size; }
36 
37  constexpr inline const_iterator begin() const { return m_data; }
38 
39  constexpr inline const_iterator end() const { return m_data + m_size; }
40 
41  constexpr inline id_type id() const { return m_id; }
42 
43  constexpr inline size_type size() const { return m_size; }
44 
45  private:
46  //for testing
47  friend class ::TestDataFrame;
48 
49  constexpr data_type *data() { return const_cast<data_type *>(m_data); }
50 
52  data_type const *m_data;
54  };
55 } // namespace edm
56 
57 #endif // DataFormats_Common_DataFrame_h
mps_fire.i
i
Definition: mps_fire.py:355
edm::DataFrame::data
constexpr data_type * data()
Definition: DataFrame.h:49
edm::DataFrame::begin
constexpr const_iterator begin() const
Definition: DataFrame.h:37
edm::DataFrame::set
void set(DataFrameContainer const &icont, size_type i)
Definition: DataFrameContainer.h:193
edm::DataFrame::operator[]
constexpr data_type & operator[](size_type i)
Definition: DataFrame.h:29
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::DataFrame::DataFrame
constexpr DataFrame(id_type i, data_type const *idata, size_type isize)
Definition: DataFrame.h:24
edm::DataFrame::m_data
const data_type * m_data
Definition: DataFrame.h:52
edm::DataFrame::iterator
data_type * iterator
Definition: DataFrame.h:20
edm::DataFrame::size_type
unsigned int size_type
Definition: DataFrame.h:17
edm::DataFrame::m_id
id_type m_id
Definition: DataFrame.h:51
edm::DataFrame::const_iterator
const data_type * const_iterator
Definition: DataFrame.h:21
edm::DataFrame
Definition: DataFrame.h:15
edm::DataFrame::id_type
unsigned int id_type
Definition: DataFrame.h:18
edm::DataFrame::end
constexpr iterator end()
Definition: DataFrame.h:35
edm::DataFrame::operator[]
constexpr data_type operator[](size_type i) const
Definition: DataFrame.h:31
edm::DataFrame::DataFrame
constexpr DataFrame()
Definition: DataFrame.h:23
edm::DataFrame::size
constexpr size_type size() const
Definition: DataFrame.h:43
edm::DataFrameContainer
Definition: DataFrameContainer.h:33
edm::DataFrame::data_type
unsigned short data_type
Definition: DataFrame.h:19
edm::DataFrame::id
constexpr id_type id() const
Definition: DataFrame.h:41
edm::DataFrame::m_size
size_type m_size
Definition: DataFrame.h:53
edm::DataFrame::begin
constexpr iterator begin()
Definition: DataFrame.h:33
edm::DataFrame::end
constexpr const_iterator end() const
Definition: DataFrame.h:39