4 #include <boost/interprocess/shared_memory_object.hpp>
5 #include <boost/interprocess/mapped_region.hpp>
12 #include "Mu2e-STMDAQ/utils/async_logger.hh"
14 #include "Mu2e-STMDAQ/utils/signal_handler.hh"
16 #include "Mu2e-STMDAQ/utils/ring_buffer.hh"
18 #include "Mu2e-STMDAQ/utils/operations_base.hh"
20 using namespace boost::interprocess;
58 const std::shared_ptr<AsyncLogger>& logger;
60 const std::shared_ptr<SignalHandler>& signal;
66 boost::interprocess::shared_memory_object shm;
68 boost::interprocess::mapped_region region;
77 std::unordered_map<std::string, std::function<void(std::shared_ptr<DataStruct>&)>> functionMap;
83 const std::shared_ptr<AsyncLogger>& logger_,
84 const std::shared_ptr<SignalHandler>& signal_,
98 std::cout <<
"DQM destructor called.\n";
102 void dqm_thread(std::shared_ptr<DataStruct>& buffer);
110 void execute(
const std::string& methodName, std::shared_ptr<DataStruct>& buffer)
override {
111 if (functionMap.find(methodName) != functionMap.end()) {
112 functionMap[methodName](buffer);
114 std::cerr <<
"Error: Invalid method name '" << methodName <<
"' in DQM\n";