DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DefaultParserImpl.hpp
Go to the documentation of this file.
1
8#ifndef FLXLIBS_SRC_DEFAULTPARSERIMPL_HPP_
9#define FLXLIBS_SRC_DEFAULTPARSERIMPL_HPP_
10
11// 3rdparty, external
12#include "packetformat/block_format.hpp"
13#include "packetformat/block_parser.hpp"
14
15#include "FelixIssues.hpp"
16//#include "ReadoutTypes.hpp"
17#include "FelixStatistics.hpp"
18
19// From STD
20#include <functional>
21#include <iomanip>
22
23namespace dunedaq::flxlibs {
24
25class DefaultParserImpl : public felix::packetformat::ParserOperations
26{
27public:
34
36
37 // Public functions for re-bind
38 std::function<void(const felix::packetformat::chunk& chunk)> process_chunk_func;
39 std::function<void(const felix::packetformat::shortchunk& shortchunk)> process_shortchunk_func;
40 std::function<void(const felix::packetformat::subchunk& subchunk)> process_subchunk_func;
41 std::function<void(const felix::packetformat::block& block)> process_block_func;
42 std::function<void(const felix::packetformat::chunk& chunk)> process_chunk_with_error_func;
43 std::function<void(const felix::packetformat::subchunk& subchunk)> process_subchunk_with_error_func;
44 std::function<void(const felix::packetformat::shortchunk& shortchunk)> process_shortchunk_with_error_func;
45 std::function<void(const felix::packetformat::block& block)> process_block_with_error_func;
46
47 // Implementation of ParserOperations: They invoke the functions above
48 void chunk_processed(const felix::packetformat::chunk& chunk);
49 void shortchunk_processed(const felix::packetformat::shortchunk& shortchunk);
50 void subchunk_processed(const felix::packetformat::subchunk& subchunk);
51 void block_processed(const felix::packetformat::block& block);
52 void chunk_processed_with_error(const felix::packetformat::chunk& chunk);
53 void subchunk_processed_with_error(const felix::packetformat::subchunk& subchunk);
54 void shortchunk_process_with_error(const felix::packetformat::shortchunk& shortchunk);
55 void block_processed_with_error(const felix::packetformat::block& block);
56
57private:
58 // Default/empty implementations: No-op "processing"
59 void process_chunk(const felix::packetformat::chunk& /*chunk*/) {}
60 void process_shortchunk(const felix::packetformat::shortchunk& /*shortchunk*/) {}
61 void process_subchunk(const felix::packetformat::subchunk& /*subchunk*/) {}
62 void process_block(const felix::packetformat::block& /*block*/) {}
63 void process_chunk_with_error(const felix::packetformat::chunk& /*chunk*/) {}
64 void process_subchunk_with_error(const felix::packetformat::subchunk& /*subchunk*/) {}
65 void process_shortchunk_with_error(const felix::packetformat::shortchunk& /*shortchunk*/) {}
66 void process_block_with_error(const felix::packetformat::block& /*block*/) {}
67
68 // Statistics
70};
71
72} // namespace dunedaq::flxlibs
73
74#endif // FLXLIBS_SRC_DEFAULTPARSERIMPL_HPP_
void shortchunk_processed(const felix::packetformat::shortchunk &shortchunk)
std::function< void(const felix::packetformat::block &block)> process_block_func
std::function< void(const felix::packetformat::chunk &chunk)> process_chunk_with_error_func
DefaultParserImpl(DefaultParserImpl &&)=delete
DefaultParserImpl is not move-constructible.
void process_chunk(const felix::packetformat::chunk &)
void process_block(const felix::packetformat::block &)
std::function< void(const felix::packetformat::chunk &chunk)> process_chunk_func
std::function< void(const felix::packetformat::subchunk &subchunk)> process_subchunk_with_error_func
void block_processed_with_error(const felix::packetformat::block &block)
void subchunk_processed(const felix::packetformat::subchunk &subchunk)
DefaultParserImpl(const DefaultParserImpl &)=delete
DefaultParserImpl is not copy-constructible.
std::function< void(const felix::packetformat::shortchunk &shortchunk)> process_shortchunk_func
void process_subchunk_with_error(const felix::packetformat::subchunk &)
void shortchunk_process_with_error(const felix::packetformat::shortchunk &shortchunk)
DefaultParserImpl & operator=(DefaultParserImpl &&)=delete
DefaultParserImpl is not move-assignable.
void chunk_processed(const felix::packetformat::chunk &chunk)
void process_shortchunk(const felix::packetformat::shortchunk &)
void process_subchunk(const felix::packetformat::subchunk &)
DefaultParserImpl & operator=(const DefaultParserImpl &)=delete
DefaultParserImpl is not copy-assignable.
void process_block_with_error(const felix::packetformat::block &)
std::function< void(const felix::packetformat::subchunk &subchunk)> process_subchunk_func
void chunk_processed_with_error(const felix::packetformat::chunk &chunk)
void process_shortchunk_with_error(const felix::packetformat::shortchunk &)
void block_processed(const felix::packetformat::block &block)
std::function< void(const felix::packetformat::shortchunk &shortchunk)> process_shortchunk_with_error_func
void process_chunk_with_error(const felix::packetformat::chunk &)
void subchunk_processed_with_error(const felix::packetformat::subchunk &subchunk)
std::function< void(const felix::packetformat::block &block)> process_block_with_error_func
FELIX Initialization std::string initerror FELIX queue timed std::string queuename Unexpected chunk int ParserOps couldn t push to queue !Failed chunk