Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
puzzled_frame.hh
Go to the documentation of this file.
1 #ifndef __PUZZLED_FRAME_HH
2 #define __PUZZLED_FRAME_HH
3 
4 #include <map>
5 
6 #include "timer.hh"
7 #include "frame.hh"
8 
11 
12 #include <boost/atomic.hpp>
13 
14 /**
15  * \author cpellegrino
16  */
17 
19 {
20  public:
21 
23 
24  private:
25 
27 
29  unsigned int m_seqnumber;
30  unsigned int m_detector_id;
31  unsigned int m_datatype;
32 
33  unsigned int m_totalsize;
34 
36 
37  public:
38 
39  static boost::atomic<unsigned int> n_obj;
40 
42  :
43  m_seqnumber(0),
44  m_detector_id(0),
45  m_datatype(0),
46  m_totalsize(0),
47  m_frame_idx(0)
48  {
49  ++n_obj;
50  }
51 
53  {
54  reset();
55  --n_obj;
56  }
57 
58  void setTimer(const Timer& exp)
59  {
60  m_expiration.set(exp);
61  }
62 
63  void setSeqNumber(unsigned int seqnumber)
64  {
65  m_seqnumber = seqnumber;
66  }
67 
68  void setDataType(unsigned int datatype)
69  {
70  m_datatype = datatype;
71  }
72 
73  void setDetectorId(unsigned int detector_id)
74  {
75  m_detector_id = detector_id;
76  }
77 
78  void setFrameIndex(frame_idx_t frame_idx)
79  {
80  m_frame_idx = frame_idx;
81  }
82 
83  bool insert(CLBDataGram* datagram);
84 
85  bool hasExpired() const
86  {
87  return m_expiration.hasExpired();
88  }
89 
90  bool hasExpiredWrt(Timer const& t) const
91  {
92  return m_expiration.hasExpiredWrt(t);
93  }
94 
95  void getFrame(Frame &frame);
96 
97  void reset();
98 
99  uint32_t frameLength() const
100  {
101  return m_totalsize +
102  sizeof(DAQCommonHeader) -
103  sizeof(CLBCommonHeader) * m_container.size();
104  }
105 
106  uint32_t frameDomStatus(int i = 1) const;
107 };
108 
109 #endif
uint32_t frameDomStatus(int i=1) const
bool hasExpiredWrt(Timer const &t) const
bool hasExpired() const
Definition: timer.cc:21
bool insert(CLBDataGram *datagram)
bool hasExpired() const
uint64_t frame_idx_t
void setDetectorId(unsigned int detector_id)
unsigned int m_detector_id
void setTimer(const Timer &exp)
frame_idx_t m_frame_idx
void setDataType(unsigned int datatype)
void setFrameIndex(frame_idx_t frame_idx)
bool hasExpiredWrt(Timer const &t) const
Definition: timer.cc:7
unsigned int m_seqnumber
std::map< unsigned int, CLBDataGram * > container_t
unsigned int m_totalsize
void set(long int seconds, long int useconds)
Definition: timer.cc:27
uint32_t frameLength() const
Template Frame for ARS data.
Definition: frame.hh:12
void getFrame(Frame &frame)
container_t m_container
unsigned int m_datatype
Timer m_expiration
Definition: timer.hh:10
void setSeqNumber(unsigned int seqnumber)
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
static boost::atomic< unsigned int > n_obj