9 namespace itk::itkpix::endec {
65 virtual void add_hit(uint16_t col, uint16_t row, uint16_t tot) = 0;
72 virtual void add_hmap(uint8_t qcol, uint8_t qrow, uint16_t hmap, uint64_t tots) = 0;
78 virtual void add_qcore(uint8_t qcol, uint8_t qrow, uint64_t qtot) = 0;
93 std::destructible<T> and
94 requires(T
self, uint8_t tag) {
95 {
self.evt_init(tag) } -> std::same_as<void>;
96 {
self.evt_next(tag) } -> std::same_as<void>;
99 {
self.evt_done() } -> std::same_as<void>;
101 requires(T
self, uint16_t col, uint16_t row, uint16_t tot) {
102 {
self.add_hit(col, row, tot) } -> std::same_as<void>;
104 requires(T
self, uint8_t qcol, uint8_t qrow, uint16_t hmap, uint64_t tots) {
105 {
self.add_hmap(qcol, qrow, hmap, tots) } -> std::same_as<void>;
107 requires(T
self, uint8_t qcol, uint8_t qrow, uint64_t qtot) {
108 {
self.add_qcore(qcol, qrow, qtot) } -> std::same_as<void>;
110 requires(T
self, EventError error) {
111 {
self.on_error(error) } -> std::same_as<uint8_t>;
Definition: test_fragment.cpp:183
Callback interface for event.
Definition: evtcallback.hpp:45
virtual void evt_done()=0
Complete the event and finalize the stream.
virtual void add_hit(uint16_t col, uint16_t row, uint16_t tot)=0
Add hit.
virtual uint8_t on_error(EventError error)=0
Callback on decoding error.
virtual void add_qcore(uint8_t qcol, uint8_t qrow, uint64_t qtot)=0
Add quarter core: tots are decoded to 64 bit qtot, no-hit marked as 0xF.
virtual ~EventCallback()=default
Destructor.
virtual void evt_init(uint8_t tag)=0
Initialize a new stream and create a new event.
virtual void add_hmap(uint8_t qcol, uint8_t qrow, uint16_t hmap, uint64_t tots)=0
Add quarter core: rawmap is decoded, tots are not decoded.
virtual void evt_next(uint8_t tag)=0
Complete the event and start the next one.
Callback on event decoding error.
Definition: evtcallback.hpp:15
error_t code
error code
Definition: evtcallback.hpp:32
uint8_t qrow
error qrow
Definition: evtcallback.hpp:34
error_t
Decoding errors.
Definition: evtcallback.hpp:18
@ DATA_AFTER_EOS
dropping data after EOS
Definition: evtcallback.hpp:28
@ UNDEFINED
undefined
Definition: evtcallback.hpp:19
@ NO_ZERO_CCOL
no ccol = '000000' at the end of stream
Definition: evtcallback.hpp:21
@ QROW_RANGE_ERROR
qrow out of range
Definition: evtcallback.hpp:24
@ TOT_NOHIT_ERROR
appeared "no hit" ToT = 0xF, which should never appear
Definition: evtcallback.hpp:29
@ TRUNCATED_STREAM
truncated stream
Definition: evtcallback.hpp:22
@ QROW_ORDER_ERROR
incorrect order of qrow
Definition: evtcallback.hpp:26
@ QROW_NOT_ASSIGNED
qrow is not assigned
Definition: evtcallback.hpp:25
@ QCOL_RANGE_ERROR
qcol out of range
Definition: evtcallback.hpp:23
@ DROPPED_FRAMES
dropped 64 bit words
Definition: evtcallback.hpp:20
@ WRONG_STATE_ERROR
wrong state
Definition: evtcallback.hpp:27
uint8_t qcol
error qcol
Definition: evtcallback.hpp:33