DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
asiolibs
src
CreateSource.hpp
Go to the documentation of this file.
1
8
#ifndef ASIOLIBS_SRC_CREATESOURCE_HPP_
9
#define ASIOLIBS_SRC_CREATESOURCE_HPP_
10
11
#include "
SourceConcept.hpp
"
12
#include "
SourceModel.hpp
"
13
#include "
datahandlinglibs/DataHandlingIssues.hpp
"
14
15
#include "
fdreadoutlibs/CRTBernTypeAdapter.hpp
"
16
#include "
fdreadoutlibs/CRTGrenobleTypeAdapter.hpp
"
17
#include "
fdreadoutlibs/DUNEWIBEthTypeAdapter.hpp
"
18
19
#include <memory>
20
#include <string>
21
22
namespace
dunedaq
{
23
24
DUNE_DAQ_TYPESTRING
(dunedaq::fdreadoutlibs::types::DUNEWIBEthTypeAdapter,
"WIBEthFrame"
)
25
DUNE_DAQ_TYPESTRING
(dunedaq::
fdreadoutlibs
::types::CRTBernTypeAdapter,
"CRTBernFrame"
)
26
DUNE_DAQ_TYPESTRING
(dunedaq::
fdreadoutlibs
::types::CRTGrenobleTypeAdapter,
"CRTGrenobleFrame"
)
27
28
namespace
asiolibs
{
29
30
std::shared_ptr<SourceConcept>
31
createSourceModel
(
const
appmodel::DataMoveCallbackConf
* conf)
32
{
33
auto
datatype = conf->
get_data_type
();
34
TLOG
() <<
"Choosing specializations for SourceModel for output connection "
35
<<
" [uid:"
<< conf->
UID
() <<
" , data_type:"
<< datatype <<
']'
;
36
37
if
(datatype.find(
"WIBEthFrame"
) != std::string::npos) {
38
// Create Model
39
auto
source_model = std::make_shared<SourceModel<fdreadoutlibs::types::DUNEWIBEthTypeAdapter>>();
40
41
// For callback acquisition later (lazy)
42
source_model->set_sink_config(conf);
43
44
// Get parser and sink
45
// auto& parser = source_model->get_parser();
46
// auto& sink = source_model->get_sink();
47
// auto& error_sink = source_model->get_error_sink();
48
49
// Modify parser as needed...
50
// parser.process_chunk_func =
51
// parsers::fixsizedChunkInto<fdreadoutlibs::types::ProtoWIBSuperChunkTypeAdapter>(sink); if (error_sink != nullptr)
52
// {
53
// parser.process_chunk_with_error_func = parsers::errorChunkIntoSink(error_sink);
54
//}
55
// parser.process_block_func = ...
56
57
// Return with setup model
58
return
source_model;
59
60
}
else
if
(datatype.find(
"CRTBernFrame"
) != std::string::npos) {
61
auto
source_model = std::make_shared<SourceModel<fdreadoutlibs::types::CRTBernTypeAdapter>>();
62
source_model->set_sink_config(conf);
63
return
source_model;
64
}
else
if
(datatype.find(
"CRTGrenobleFrame"
) != std::string::npos) {
65
auto
source_model = std::make_shared<SourceModel<fdreadoutlibs::types::CRTGrenobleTypeAdapter>>();
66
source_model->set_sink_config(conf);
67
return
source_model;
68
}
69
70
return
nullptr
;
71
}
72
73
}
// namespace asiolibs
74
}
// namespace dunedaq
75
76
#endif
// ASIOLIBS_SRC_CREATESOURCE_HPP_
CRTBernTypeAdapter.hpp
CRTGrenobleTypeAdapter.hpp
DUNEWIBEthTypeAdapter.hpp
DataHandlingIssues.hpp
DUNE_DAQ_TYPESTRING
#define DUNE_DAQ_TYPESTRING(Type, typestring)
Declare the datatype_to_string method for the given type.
Definition
Serialization.hpp:36
SourceConcept.hpp
SourceModel.hpp
dunedaq::appmodel::DataMoveCallbackConf
Definition
DataMoveCallbackConf.hpp:20
dunedaq::appmodel::DataMoveCallbackConf::get_data_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...
Definition
DataMoveCallbackConf.hpp:125
dunedaq::conffwk::DalObject::UID
const std::string & UID() const noexcept
Definition
DalObject.hpp:119
TLOG
#define TLOG(...)
Definition
macro.hpp:21
dunedaq::asiolibs
Definition
CreateGenericReceiver.hpp:25
dunedaq::asiolibs::createSourceModel
std::shared_ptr< SourceConcept > createSourceModel(const appmodel::DataMoveCallbackConf *conf)
Definition
CreateSource.hpp:31
dunedaq::fdreadoutlibs
Definition
CRTBernFrameProcessor.hpp:16
dunedaq
The DUNE-DAQ namespace.
Definition
cib_utilities.cpp:5
Generated on
for DUNE-DAQ by
1.18.0