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

Namespaces

namespace  opmon
 
namespace  python
 

Classes

class  SourceConcept
 
class  SourceModel
 

Functions

std::shared_ptr< SourceConceptcreateSourceModel (const std::string &conn_uid, bool callback_mode)
 

Function Documentation

◆ createSourceModel()

std::shared_ptr< SourceConcept > dunedaq::crtmodules::createSourceModel ( const std::string & conn_uid,
bool callback_mode )

Definition at line 29 of file CreateSource.hpp.

30{
31 auto datatypes = dunedaq::iomanager::IOManager::get()->get_datatypes(conn_uid);
32 if (datatypes.size() != 1) {
33 ers::error(dunedaq::datahandlinglibs::GenericConfigurationError(ERS_HERE,
34 "Multiple output data types specified! Expected only a single type!"));
35 }
36 std::string raw_dt{ *datatypes.begin() };
37 TLOG() << "Choosing specializations for SourceModel for output connection "
38 << " [uid:" << conn_uid << " , data_type:" << raw_dt << ']';
39
40 if (raw_dt.find("CRTBernFrame") != std::string::npos) {
41 auto source_model = std::make_shared<SourceModel<fdreadoutlibs::types::CRTBernTypeAdapter>>();
42 source_model->set_sink_name(conn_uid);
43 source_model->set_sink(conn_uid, callback_mode);
44 return source_model;
45 } else if (raw_dt.find("CRTGrenobleFrame") != std::string::npos) {
46 auto source_model = std::make_shared<SourceModel<fdreadoutlibs::types::CRTGrenobleTypeAdapter>>();
47 source_model->set_sink_name(conn_uid);
48 source_model->set_sink(conn_uid, callback_mode);
49 return source_model;
50 }
51
52 return nullptr;
53}
#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