Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
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),
45 m_datatype(0),
46 m_totalsize(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 {
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
Template Frame for ARS data.
Definition frame.hh:13
unsigned int m_totalsize
static boost::atomic< unsigned int > n_obj
void setDetectorId(unsigned int detector_id)
unsigned int m_datatype
void setSeqNumber(unsigned int seqnumber)
void setFrameIndex(frame_idx_t frame_idx)
std::map< unsigned int, CLBDataGram * > container_t
bool hasExpired() const
void getFrame(Frame &frame)
bool insert(CLBDataGram *datagram)
container_t m_container
uint32_t frameDomStatus(int i=1) const
void setDataType(unsigned int datatype)
unsigned int m_detector_id
unsigned int m_seqnumber
bool hasExpiredWrt(Timer const &t) const
uint32_t frameLength() const
void setTimer(const Timer &exp)
frame_idx_t m_frame_idx
Definition timer.hh:11
bool hasExpiredWrt(Timer const &t) const
Definition timer.cc:7
void set(long int seconds, long int useconds)
Definition timer.cc:27
bool hasExpired() const
Definition timer.cc:21
uint64_t frame_idx_t