DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
FakeCardReaderBase.hpp
Go to the documentation of this file.
1
12#ifndef DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_FAKECARDREADERBASE_HPP_
13#define DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_FAKECARDREADERBASE_HPP_
14
15// package
17
26
28#include "appfwk/DAQModule.hpp"
29
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 datahandlinglibs {
45
47{
48public:
53 explicit FakeCardReaderBase(const std::string& name);
55
60
61 void init(std::shared_ptr<appfwk::ConfigurationManager> cfg);
62
63 // To be implemented by final module
64 virtual std::shared_ptr<datahandlinglibs::SourceEmulatorConcept> create_source_emulator(
66 std::atomic<bool>& run_marker) = 0;
67
68 // Commands
69 void do_conf(const appfwk::DAQModule::CommandData_t& /*args*/);
70 void do_scrap(const appfwk::DAQModule::CommandData_t& /*args*/);
71 void do_start(const appfwk::DAQModule::CommandData_t& /*args*/);
72 void do_stop(const appfwk::DAQModule::CommandData_t& /*args*/);
73
74 std::string get_fcr_name() { return m_name; }
75
76private:
77 // Configuration
79 std::string m_name;
80 std::shared_ptr<appfwk::ConfigurationManager> m_cfg;
81
82 std::map<std::string, std::shared_ptr<datahandlinglibs::SourceEmulatorConcept>> m_source_emus;
83
84 // Internals
85 std::unique_ptr<datahandlinglibs::FileSourceBuffer> m_source_buffer;
86
87 // Threading
88 std::atomic<bool> m_run_marker;
89};
90
91} // namespace datahandlinglibs
92} // namespace dunedaq
93
94// Declarations
96
97#endif // DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_FAKECARDREADERBASE_HPP_
FakeCardReaderBase & operator=(FakeCardReaderBase &&)=delete
FakeCardReaderBase is not move-assignable.
std::unique_ptr< datahandlinglibs::FileSourceBuffer > m_source_buffer
void init(std::shared_ptr< appfwk::ConfigurationManager > cfg)
void do_stop(const appfwk::DAQModule::CommandData_t &)
FakeCardReaderBase(FakeCardReaderBase &&)=delete
FakeCardReaderBase is not move-constructible.
void do_scrap(const appfwk::DAQModule::CommandData_t &)
void do_conf(const appfwk::DAQModule::CommandData_t &)
std::map< std::string, std::shared_ptr< datahandlinglibs::SourceEmulatorConcept > > m_source_emus
virtual std::shared_ptr< datahandlinglibs::SourceEmulatorConcept > create_source_emulator(const appmodel::DataMoveCallbackConf *cb, std::atomic< bool > &run_marker)=0
FakeCardReaderBase & operator=(const FakeCardReaderBase &)=delete
FakeCardReaderBase is not copy-assignable.
FakeCardReaderBase(const FakeCardReaderBase &)=delete
FakeCardReaderBase is not copy-constructible.
std::shared_ptr< appfwk::ConfigurationManager > m_cfg
FakeCardReaderBase(const std::string &name)
FakeCardReaderBase Constructor.
void do_start(const appfwk::DAQModule::CommandData_t &)
std::atomic< bool > run_marker
Global atomic for process lifetime.
The DUNE-DAQ namespace.