DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::asiolibs Namespace Reference

Namespaces

namespace  opmon
 

Classes

class  GenericReceiverConcept
 
class  GenericReceiverModel
 
class  SourceConcept
 
class  SourceModel
 

Functions

std::shared_ptr< GenericReceiverConceptcreateGenericReceiver (const std::string &conn_uid, const std::string &raw_data_receiver_connection_name)
 
std::shared_ptr< SourceConceptcreateSourceModel (const appmodel::DataMoveCallbackConf *conf)
 

Function Documentation

◆ createGenericReceiver()

std::shared_ptr< GenericReceiverConcept > dunedaq::asiolibs::createGenericReceiver ( const std::string & conn_uid,
const std::string & raw_data_receiver_connection_name )

Definition at line 27 of file CreateGenericReceiver.hpp.

28{
29 const auto datatypes = dunedaq::iomanager::IOManager::get()->get_datatypes(conn_uid);
30 if (datatypes.size() != 1) {
31 ers::error(dunedaq::datahandlinglibs::GenericConfigurationError(ERS_HERE,
32 "Multiple output data types specified! Expected only a single type!"));
33 }
34 const std::string raw_dt = *datatypes.begin();
35 TLOG() << "Choosing specializations for GenericReceiverConcept for output connection "
36 << " [uid:" << conn_uid << " , data_type:" << raw_dt << ']';
37
38 if (raw_dt.find("CRTBernFrame") != std::string::npos) {
39 return std::make_shared<GenericReceiverModel<fdreadoutlibs::types::CRTBernTypeAdapter>>(raw_data_receiver_connection_name);
40 } else if (raw_dt.find("CRTGrenobleFrame") != std::string::npos) {
41 return std::make_shared<GenericReceiverModel<fdreadoutlibs::types::CRTGrenobleTypeAdapter>>(raw_data_receiver_connection_name);
42 }
43
44 return nullptr;
45}
#define ERS_HERE
static std::shared_ptr< IOManager > get()
Definition IOManager.hpp:40
#define TLOG(...)
Definition macro.hpp:22
void error(const Issue &issue)
Definition ers.hpp:81

◆ createSourceModel()

std::shared_ptr< SourceConcept > dunedaq::asiolibs::createSourceModel ( const appmodel::DataMoveCallbackConf * conf)

Definition at line 33 of file CreateSource.hpp.

34{
35 auto datatype = conf->get_data_type();
36 TLOG() << "Choosing specializations for SourceModel for output connection "
37 << " [uid:" << conf->UID() << " , data_type:" << datatype << ']';
38
39 if (datatype.find("WIBEthFrame") != std::string::npos) {
40 // Create Model
41 auto source_model = std::make_shared<SourceModel<fdreadoutlibs::types::DUNEWIBEthTypeAdapter>>();
42
43 // For callback acquisition later (lazy)
44 source_model->set_sink_config(conf);
45
46 // Get parser and sink
47 //auto& parser = source_model->get_parser();
48 //auto& sink = source_model->get_sink();
49 //auto& error_sink = source_model->get_error_sink();
50
51 // Modify parser as needed...
52 //parser.process_chunk_func = parsers::fixsizedChunkInto<fdreadoutlibs::types::ProtoWIBSuperChunkTypeAdapter>(sink);
53 //if (error_sink != nullptr) {
54 // parser.process_chunk_with_error_func = parsers::errorChunkIntoSink(error_sink);
55 //}
56 // parser.process_block_func = ...
57
58 // Return with setup model
59 return source_model;
60
61 } else if (datatype.find("TDEFrame") != std::string::npos) {
62 // WIB2 specific char arrays
63 auto source_model = std::make_shared<SourceModel<fdreadoutlibs::types::TDEFrameTypeAdapter>>();
64 source_model->set_sink_config(conf);
65 //auto& parser = source_model->get_parser();
66 //parser.process_chunk_func = parsers::fixsizedChunkInto<fdreadoutlibs::types::DUNEWIBSuperChunkTypeAdapter>(sink);
67 return source_model;
68 } else if (datatype.find("CRTBernFrame") != std::string::npos) {
69 auto source_model = std::make_shared<SourceModel<fdreadoutlibs::types::CRTBernTypeAdapter>>();
70 source_model->set_sink_config(conf);
71 return source_model;
72 } else if (datatype.find("CRTGrenobleFrame") != std::string::npos) {
73 auto source_model = std::make_shared<SourceModel<fdreadoutlibs::types::CRTGrenobleTypeAdapter>>();
74 source_model->set_sink_config(conf);
75 return source_model;
76 }
77
78 return nullptr;
79}
const std::string & get_data_type() const
Get "data_type" attribute value. Name of the output data type. Should be defined via a call to DUNE_D...
const std::string & UID() const noexcept