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
26
28#include "appfwk/DAQModule.hpp"
29
31
32#include "rcif/cmd/Nljs.hpp"
33
34// std
35#include <cstdint>
36#include <fstream>
37#include <map>
38#include <memory>
39#include <string>
40#include <vector>
41
42namespace dunedaq {
43namespace snbmodules {
44
46{
47public:
52 explicit FileReaderBase(const std::string& name);
53 virtual ~FileReaderBase() {}
54
55 FileReaderBase(const FileReaderBase&) = delete;
59
60 void init(std::shared_ptr<appfwk::ConfigurationManager> cfg);
61
62 // To be implemented by final module
63 virtual std::shared_ptr<snbmodules::FileSourceConcept> create_source_emulator(std::string qi,
64 std::atomic<bool>& run_marker) = 0;
65
66 // Commands
67 void do_conf(const appfwk::DAQModule::CommandData_t& /*args*/);
68 void do_scrap(const appfwk::DAQModule::CommandData_t& /*args*/);
69 void do_start(const appfwk::DAQModule::CommandData_t& /*args*/);
70 void do_stop(const appfwk::DAQModule::CommandData_t& /*args*/);
71
72 std::string get_fcr_name() { return m_name; }
73
74private:
75 // Configuration
77 std::string m_name;
78 std::shared_ptr<appfwk::ConfigurationManager> m_cfg;
79
80 std::map<std::string, std::shared_ptr<snbmodules::FileSourceConcept>> m_source_emus;
81
82 // Threading
83 std::atomic<bool> m_run_marker;
84};
85
86} // namespace snbmodules
87} // namespace dunedaq
88
89// Declarations
91
92#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)
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.
virtual std::shared_ptr< snbmodules::FileSourceConcept > create_source_emulator(std::string qi, std::atomic< bool > &run_marker)=0
std::atomic< bool > run_marker
Global atomic for process lifetime.
The DUNE-DAQ namespace.