DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CreateSource.hpp
Go to the documentation of this file.
1
8#ifndef CRTMODULES_SRC_CREATESOURCE_HPP_
9#define CRTMODULES_SRC_CREATESOURCE_HPP_
10
11#include "SourceConcept.hpp"
12#include "SourceModel.hpp"
14
17
18#include <memory>
19#include <string>
20
21namespace dunedaq {
22
24DUNE_DAQ_TYPESTRING(dunedaq::fdreadoutlibs::types::CRTGrenobleTypeAdapter, "CRTGrenobleFrame")
25
26namespace crtmodules {
27
28std::shared_ptr<SourceConcept>
30{
31 auto datatype = conf->get_data_type();
32 TLOG() << "Choosing specializations for SourceModel for output connection "
33 << " [uid:" << conf->UID() << " , data_type:" << datatype << ']';
34
35 if (datatype.find("CRTBernFrame") != std::string::npos) {
36 auto source_model = std::make_shared<SourceModel<fdreadoutlibs::types::CRTBernTypeAdapter>>();
37 source_model->set_sink_config(conf);
38 return source_model;
39 } else if (datatype.find("CRTGrenobleFrame") != std::string::npos) {
40 auto source_model = std::make_shared<SourceModel<fdreadoutlibs::types::CRTGrenobleTypeAdapter>>();
41 source_model->set_sink_config(conf);
42 return source_model;
43 }
44
45 return nullptr;
46}
47
48} // namespace crtmodules
49} // namespace dunedaq
50
51#endif // CRTMODULES_SRC_CREATESOURCE_HPP_
#define DUNE_DAQ_TYPESTRING(Type, typestring)
Declare the datatype_to_string method for the given type.
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
#define TLOG(...)
Definition macro.hpp:22
std::shared_ptr< SourceConcept > createSourceModel(const appmodel::DataMoveCallbackConf *conf)
Including Qt Headers.