DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
RequestHandlerConcept.hpp
Go to the documentation of this file.
1
8#ifndef DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_CONCEPTS_REQUESTHANDLERCONCEPT_HPP_
9#define DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_CONCEPTS_REQUESTHANDLERCONCEPT_HPP_
10
16
17#include <map>
18#include <memory>
19#include <string>
20#include <utility>
21
22namespace dunedaq {
23namespace datahandlinglibs {
24
25template<class ReadoutType, class LatencyBufferType>
27{
28
29public:
31
33
36 delete;
39
40 //virtual void init(const nlohmann::json& args) = 0;
41 virtual void conf(const appmodel::DataHandlerModule* conf) = 0;
42 virtual void scrap(const nlohmann::json& args) = 0;
43 virtual void start(const nlohmann::json& args) = 0;
44 virtual void stop(const nlohmann::json& args) = 0;
45 virtual void record(const nlohmann::json& args) = 0;
46
48 virtual void cleanup_check() = 0;
49
51 virtual void periodic_data_transmission() = 0;
52
54 virtual void issue_request(dfmessages::DataRequest /*dr*/, bool /*is_retry*/) = 0;
55
56
57protected:
58 // Result code of requests
70 std::map<ResultCode, std::string> ResultCodeStrings{
71 { ResultCode::kFound, "FOUND" }, { ResultCode::kNotFound, "NOT_FOUND" },
72 { ResultCode::kTooOld, "TOO_OLD" }, { ResultCode::kNotYet, "NOT_YET_PRESENT" },
73 { ResultCode::kPartiallyOld, "PARTIALLY_PASSED" }, { ResultCode::kCleanup, "CLEANUP" },
74 { ResultCode::kUnknown, "UNKNOWN" }
75 };
76
77 inline const std::string& resultCodeAsString(ResultCode rc) { return ResultCodeStrings[rc]; }
78
79 // Request Result
96
97 virtual void cleanup() = 0;
99
100private:
101};
102
103} // namespace datahandlinglibs
104} // namespace dunedaq
105
106#endif // DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_CONCEPTS_REQUESTHANDLERCONCEPT_HPP_
C++ Representation of a DUNE Fragment, wrapping the flat byte array that is the Fragment's "actual" f...
Definition Fragment.hpp:38
virtual void record(const nlohmann::json &args)=0
virtual void periodic_data_transmission()=0
Periodic data transmission - relevant for trigger in particular.
virtual void start(const nlohmann::json &args)=0
virtual void stop(const nlohmann::json &args)=0
const std::string & resultCodeAsString(ResultCode rc)
RequestHandlerConcept(const RequestHandlerConcept &)=delete
RequestHandlerConcept is not copy-constructible.
virtual RequestResult data_request(dfmessages::DataRequest)=0
RequestHandlerConcept & operator=(RequestHandlerConcept &&)=delete
RequestHandlerConcept is not move-assignable.
std::map< ResultCode, std::string > ResultCodeStrings
virtual void cleanup_check()=0
Check if cleanup is necessary and execute it if necessary.
virtual void scrap(const nlohmann::json &args)=0
RequestHandlerConcept & operator=(const RequestHandlerConcept &)=delete
RequestHandlerConcept is not copy-assginable.
virtual void conf(const appmodel::DataHandlerModule *conf)=0
virtual void issue_request(dfmessages::DataRequest, bool)=0
Issue a data request to the request handler.
RequestHandlerConcept(RequestHandlerConcept &&)=delete
RequestHandlerConcept is not move-constructible.
Including Qt Headers.
RequestResult(ResultCode rc, dfmessages::DataRequest dr, daqdataformats::Fragment &&frag)
This message represents a request for data sent to a single component of the DAQ.