Line data Source code
1 :
2 : /**
3 : * @file SourceConcept.hpp SourceConcept for constructors and
4 : * forwarding command args. Enforces the implementation to
5 : * queue in UDP JUMBO frames to be translated to TypeAdapters and
6 : * send them to corresponding sinks.
7 : *
8 : * This is part of the DUNE DAQ , copyright 2020.
9 : * Licensing/copyright details are in the COPYING file that you should have
10 : * received with this code.
11 : */
12 : #ifndef ASIOLIBS_SRC_SOURCECONCEPT_HPP_
13 : #define ASIOLIBS_SRC_SOURCECONCEPT_HPP_
14 :
15 : //#include "DefaultParserImpl.hpp"
16 :
17 : #include "opmonlib/MonitorableObject.hpp"
18 : #include "appfwk/DAQModule.hpp"
19 : #include "appmodel/DataMoveCallbackConf.hpp"
20 : //#include "packetformat/detail/block_parser.hpp"
21 : #include <nlohmann/json.hpp>
22 :
23 : #include <memory>
24 : #include <sstream>
25 : #include <string>
26 :
27 : namespace dunedaq {
28 : namespace asiolibs {
29 :
30 : class SourceConcept : public opmonlib::MonitorableObject
31 : {
32 : public:
33 0 : SourceConcept() {}
34 0 : virtual ~SourceConcept() {}
35 :
36 : SourceConcept(const SourceConcept&) = delete; ///< SourceConcept is not copy-constructible
37 : SourceConcept& operator=(const SourceConcept&) = delete; ///< SourceConcept is not copy-assginable
38 : SourceConcept(SourceConcept&&) = delete; ///< SourceConcept is not move-constructible
39 : SourceConcept& operator=(SourceConcept&&) = delete; ///< SourceConcept is not move-assignable
40 :
41 : // virtual void init(const nlohmann::json& args) = 0;
42 : virtual void acquire_callback() = 0;
43 : // virtual void conf(const nlohmann::json& args) = 0;
44 : // virtual void start(const nlohmann::json& args) = 0;
45 : // virtual void stop(const nlohmann::json& args) = 0;
46 :
47 : virtual bool handle_payload(char* message, std::size_t size) = 0;
48 : virtual std::size_t get_target_payload_size() const = 0;
49 :
50 0 : void set_sink_config(const appmodel::DataMoveCallbackConf* sink_conf)
51 : {
52 0 : m_sink_conf = sink_conf;
53 0 : }
54 :
55 : const appmodel::DataMoveCallbackConf* m_sink_conf;
56 : };
57 :
58 : } // namespace asiolibs
59 : } // namespace dunedaq
60 :
61 : #endif // ASIOLIBS_SRC_SOURCECONCEPT_HPP_
|