DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::datahandlinglibs::RawDataHandlerBase Class Referenceabstract

#include <RawDataHandlerBase.hpp>

Public Member Functions

 RawDataHandlerBase (const std::string &name)
 RawDataHandlerBase Constructor.
 
virtual ~RawDataHandlerBase ()
 
 RawDataHandlerBase (const RawDataHandlerBase &)=delete
 RawDataHandlerBase is not copy-constructible.
 
RawDataHandlerBaseoperator= (const RawDataHandlerBase &)=delete
 RawDataHandlerBase is not copy-assignable.
 
 RawDataHandlerBase (RawDataHandlerBase &&)=delete
 RawDataHandlerBase is not move-constructible.
 
RawDataHandlerBaseoperator= (RawDataHandlerBase &&)=delete
 RawDataHandlerBase is not move-assignable.
 
void init (std::shared_ptr< appfwk::ConfigurationManager > cfg)
 
virtual std::shared_ptr< dunedaq::datahandlinglibs::DataHandlingConceptcreate_readout (const appmodel::DataHandlerModule *modconf, std::atomic< bool > &run_marker)=0
 
void do_conf (const nlohmann::json &)
 
void do_scrap (const nlohmann::json &)
 
void do_start (const nlohmann::json &)
 
void do_stop (const nlohmann::json &)
 
void do_record (const nlohmann::json &)
 
std::string get_dlh_name ()
 

Private Attributes

bool m_configured
 
daqdataformats::run_number_t m_run_number
 
std::string m_name
 
std::shared_ptr< datahandlinglibs::DataHandlingConceptm_readout_impl
 
std::atomic< bool > m_run_marker
 

Detailed Description

Definition at line 34 of file RawDataHandlerBase.hpp.

Constructor & Destructor Documentation

◆ RawDataHandlerBase() [1/3]

dunedaq::datahandlinglibs::RawDataHandlerBase::RawDataHandlerBase ( const std::string & name)
explicit

RawDataHandlerBase Constructor.

Parameters
nameInstance name for this RawDataHandlerBase instance

Definition at line 4 of file RawDataHandlerBase.hxx.

5 : m_configured(false)
6 , m_name(name)
7 , m_readout_impl(nullptr)
8 , m_run_marker{ false }
9{
10/*
11 register_command("conf", &RawDataHandlerBase::do_conf);
12 register_command("scrap", &RawDataHandlerBase::do_scrap);
13 register_command("start", &RawDataHandlerBase::do_start);
14 register_command("stop_trigger_sources", &RawDataHandlerBase::do_stop);
15 register_command("record", &RawDataHandlerBase::do_record);
16*/
17}
std::shared_ptr< datahandlinglibs::DataHandlingConcept > m_readout_impl

◆ ~RawDataHandlerBase()

virtual dunedaq::datahandlinglibs::RawDataHandlerBase::~RawDataHandlerBase ( )
inlinevirtual

Definition at line 42 of file RawDataHandlerBase.hpp.

42{}

◆ RawDataHandlerBase() [2/3]

dunedaq::datahandlinglibs::RawDataHandlerBase::RawDataHandlerBase ( const RawDataHandlerBase & )
delete

RawDataHandlerBase is not copy-constructible.

◆ RawDataHandlerBase() [3/3]

dunedaq::datahandlinglibs::RawDataHandlerBase::RawDataHandlerBase ( RawDataHandlerBase && )
delete

RawDataHandlerBase is not move-constructible.

Member Function Documentation

◆ create_readout()

virtual std::shared_ptr< dunedaq::datahandlinglibs::DataHandlingConcept > dunedaq::datahandlinglibs::RawDataHandlerBase::create_readout ( const appmodel::DataHandlerModule * modconf,
std::atomic< bool > & run_marker )
pure virtual

◆ do_conf()

void dunedaq::datahandlinglibs::RawDataHandlerBase::do_conf ( const nlohmann::json & args)

Definition at line 45 of file RawDataHandlerBase.hxx.

◆ do_record()

void dunedaq::datahandlinglibs::RawDataHandlerBase::do_record ( const nlohmann::json & args)

Definition at line 84 of file RawDataHandlerBase.hxx.

85{
86 TLOG_DEBUG(dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS) << get_dlh_name() << ": Entering do_issue_recording() method";
87 m_readout_impl->record(args);
88 TLOG_DEBUG(dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS) << get_dlh_name() << ": Exiting do_issue_recording() method";
89}

◆ do_scrap()

void dunedaq::datahandlinglibs::RawDataHandlerBase::do_scrap ( const nlohmann::json & args)

Definition at line 54 of file RawDataHandlerBase.hxx.

55{
57 m_readout_impl->scrap(args);
58 m_configured = false;
60}

◆ do_start()

void dunedaq::datahandlinglibs::RawDataHandlerBase::do_start ( const nlohmann::json & args)

Definition at line 62 of file RawDataHandlerBase.hxx.

63{
65 m_run_marker.store(true);
66 m_readout_impl->start(args);
67 rcif::cmd::StartParams start_params = args.get<rcif::cmd::StartParams>();
68 m_run_number = start_params.run;
69 TLOG() << get_dlh_name() << " successfully started for run number " << m_run_number;
71}
#define TLOG(...)
Definition macro.hpp:22

◆ do_stop()

void dunedaq::datahandlinglibs::RawDataHandlerBase::do_stop ( const nlohmann::json & args)

Definition at line 74 of file RawDataHandlerBase.hxx.

75{
77 m_run_marker.store(false);
78 m_readout_impl->stop(args);
79 TLOG() << get_dlh_name() << " successfully stopped for run number " << m_run_number;
81}

◆ get_dlh_name()

std::string dunedaq::datahandlinglibs::RawDataHandlerBase::get_dlh_name ( )
inline

Definition at line 62 of file RawDataHandlerBase.hpp.

62{ return m_name; }

◆ init()

void dunedaq::datahandlinglibs::RawDataHandlerBase::init ( std::shared_ptr< appfwk::ConfigurationManager > cfg)

Definition at line 21 of file RawDataHandlerBase.hxx.

22{
23
25 const appmodel::DataHandlerModule* modconf = cfg->get_dal<appmodel::DataHandlerModule>(get_dlh_name());
26 if(modconf == nullptr) {
27 throw dunedaq::datahandlinglibs::FailedReadoutInitialization(ERS_HERE, get_dlh_name(), "not a DataHandlerModule");
28 }
30 if (m_readout_impl == nullptr) {
31 TLOG() << get_dlh_name() << "Initialize readout implementation FAILED! "
32 << "Failed to find specialization for given queue setup!";
33 throw dunedaq::datahandlinglibs::FailedReadoutInitialization(ERS_HERE, get_dlh_name(), ""); // 4 json ident
34 }
36}
#define ERS_HERE
virtual std::shared_ptr< dunedaq::datahandlinglibs::DataHandlingConcept > create_readout(const appmodel::DataHandlerModule *modconf, std::atomic< bool > &run_marker)=0

◆ operator=() [1/2]

RawDataHandlerBase & dunedaq::datahandlinglibs::RawDataHandlerBase::operator= ( const RawDataHandlerBase & )
delete

RawDataHandlerBase is not copy-assignable.

◆ operator=() [2/2]

RawDataHandlerBase & dunedaq::datahandlinglibs::RawDataHandlerBase::operator= ( RawDataHandlerBase && )
delete

RawDataHandlerBase is not move-assignable.

Member Data Documentation

◆ m_configured

bool dunedaq::datahandlinglibs::RawDataHandlerBase::m_configured
private

Definition at line 67 of file RawDataHandlerBase.hpp.

◆ m_name

std::string dunedaq::datahandlinglibs::RawDataHandlerBase::m_name
private

Definition at line 71 of file RawDataHandlerBase.hpp.

◆ m_readout_impl

std::shared_ptr<datahandlinglibs::DataHandlingConcept> dunedaq::datahandlinglibs::RawDataHandlerBase::m_readout_impl
private

Definition at line 74 of file RawDataHandlerBase.hpp.

◆ m_run_marker

std::atomic<bool> dunedaq::datahandlinglibs::RawDataHandlerBase::m_run_marker
private

Definition at line 77 of file RawDataHandlerBase.hpp.

◆ m_run_number

daqdataformats::run_number_t dunedaq::datahandlinglibs::RawDataHandlerBase::m_run_number
private

Definition at line 68 of file RawDataHandlerBase.hpp.


The documentation for this class was generated from the following files: