DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
FileReaderBase.hpp
Go to the documentation of this file.
1
12#ifndef SNBMODULES_INCLUDE_SNBMODULES_FILEREADERBASE_HPP_
13#define SNBMODULES_INCLUDE_SNBMODULES_FILEREADERBASE_HPP_
14
15// package
17
27
29#include "appfwk/DAQModule.hpp"
30
32
33#include "rcif/cmd/Nljs.hpp"
34
35// std
36#include <cstdint>
37#include <fstream>
38#include <map>
39#include <memory>
40#include <string>
41#include <vector>
42
43namespace dunedaq {
44namespace snbmodules {
45
47{
48public:
53 explicit FileReaderBase(const std::string& name);
54 virtual ~FileReaderBase() {}
55
56 FileReaderBase(const FileReaderBase&) = delete;
60
61 void init(std::shared_ptr<appfwk::ConfigurationManager> cfg);
62
63 // To be implemented by final module
64 virtual std::shared_ptr<snbmodules::FileSourceConcept> create_source_emulator(const appmodel::DataMoveCallbackConf* cb_conf,
65 std::atomic<bool>& run_marker) = 0;
66
67 // Commands
68 void do_conf(const appfwk::DAQModule::CommandData_t& /*args*/);
69 void do_scrap(const appfwk::DAQModule::CommandData_t& /*args*/);
70 void do_start(const appfwk::DAQModule::CommandData_t& /*args*/);
71 void do_stop(const appfwk::DAQModule::CommandData_t& /*args*/);
72
73 std::string get_fcr_name() { return m_name; }
74
75private:
76 // Configuration
78 std::string m_name;
79 std::shared_ptr<appfwk::ConfigurationManager> m_cfg;
80
81 std::map<std::string, std::shared_ptr<snbmodules::FileSourceConcept>> m_source_emus;
82
83 // Threading
84 std::atomic<bool> m_run_marker;
85};
86
87} // namespace snbmodules
88} // namespace dunedaq
89
90// Declarations
92
93#endif // SNBMODULES_INCLUDE_SNBMODULES_FILEREADERBASE_HPP_
FileReaderBase(const FileReaderBase &)=delete
FileReaderBase is not copy-constructible.
void do_scrap(const appfwk::DAQModule::CommandData_t &)
void init(std::shared_ptr< appfwk::ConfigurationManager > cfg)
virtual std::shared_ptr< snbmodules::FileSourceConcept > create_source_emulator(const appmodel::DataMoveCallbackConf *cb_conf, std::atomic< bool > &run_marker)=0
void do_stop(const appfwk::DAQModule::CommandData_t &)
std::shared_ptr< appfwk::ConfigurationManager > m_cfg
FileReaderBase(FileReaderBase &&)=delete
FileReaderBase is not move-constructible.
void do_conf(const appfwk::DAQModule::CommandData_t &)
FileReaderBase & operator=(FileReaderBase &&)=delete
FileReaderBase is not move-assignable.
FileReaderBase(const std::string &name)
FileReaderBase Constructor.
std::map< std::string, std::shared_ptr< snbmodules::FileSourceConcept > > m_source_emus
void do_start(const appfwk::DAQModule::CommandData_t &)
FileReaderBase & operator=(const FileReaderBase &)=delete
FileReaderBase is not copy-assignable.
std::atomic< bool > run_marker
Global atomic for process lifetime.
Including Qt Headers.