49 std::vector<const confmodel::DaqModule*> modules;
52 std::vector<const conffwk::ConfigObject*> trmrOutputObjs;
59 auto destination_class = rule->get_destination_class();
60 if (destination_class ==
"TRMonRequestorModule") {
61 tdtQDesc = rule->get_descriptor();
64 if (tdtQDesc ==
nullptr) {
65 throw(BadConf(
ERS_HERE,
"Could not find queue descriptor rule for TriggerDecisionTokens!"));
73 auto descriptor = rule->get_descriptor();
74 auto data_type = descriptor->get_data_type();
75 if (data_type ==
"TriggerRecord") {
76 dwNetDesc = rule->get_descriptor();
79 if (dwNetDesc ==
nullptr) {
80 throw(BadConf(
ERS_HERE,
"Could not find network descriptor rule for input TriggerRecords!"));
86 std::vector<conffwk::ConfigObject> trmonreqNetObjs;
87 for (
auto [uid, descriptor]:
88 helper->get_netdescriptors(
"TRMonRequest",
"DFApplication")) {
89 trmonreqNetObjs.emplace_back(obj_fac.
create_net_obj(descriptor, uid));
93 for (
auto&
obj : trmonreqNetObjs) {
94 trmrOutputObjs.push_back(&
obj);
102 if (trmrConf ==
nullptr) {
103 throw(BadConf(
ERS_HERE,
"No TRMonRequestor configuration given"));
105 auto trmrConfObj = trmrConf->config_object();
107 std::string trmrUid(
UID() +
"-trmr");
109 trmrObj.
set_obj(
"configuration", &trmrConfObj);
110 trmrObj.
set_objs(
"inputs", { &tdtQueueObj });
111 trmrObj.
set_objs(
"outputs", trmrOutputObjs);
112 trmrObj.
set_obj(
"trigger_record_destination", &dwInputObj);
118 if (dwrConf ==
nullptr) {
119 throw(BadConf(
ERS_HERE,
"No DataWriterModule configuration given"));
122 auto dwrConfObj = dwrConf->config_object();
125 std::string dwrUid(fmt::format(
"{}-dw",
UID()));
127 dwrObj.
set_by_val(
"writer_identifier", fmt::format(
"{}_dw",
UID()));
128 dwrObj.
set_obj(
"configuration", &dwrConfObj);
129 dwrObj.
set_objs(
"inputs", { &dwInputObj });
130 dwrObj.
set_objs(
"outputs", { &tdtQueueObj });
void update_modules(const std::vector< const confmodel::DaqModule * > &modules)
conffwk::ConfigObject create_net_obj(const NetworkConnectionDescriptor *ndesc, std::string uid) const
Helper function that gets a network connection config.
const T * get_dal(std::string uid) const
conffwk::ConfigObject create_queue_obj(const QueueDescriptor *qdesc, std::string uid="") const
conffwk::ConfigObject create(const std::string &class_name, const std::string &id) const
const std::vector< const dunedaq::appmodel::NetworkConnectionRule * > & get_network_rules() const
Get "network_rules" relationship value.
const std::vector< const dunedaq::appmodel::QueueConnectionRule * > & get_queue_rules() const
Get "queue_rules" relationship value.
void generate_modules(std::shared_ptr< appmodel::ConfigurationHelper >) const override
const dunedaq::appmodel::TRMonRequestorConf * get_trmonreq() const
Get "trmonreq" relationship value. Configuration of the TRMonRequestor to be generated by get_modules...
const dunedaq::appmodel::DataWriterConf * get_data_writer() const
Get "data_writer" relationship value.
void set_by_val(const std::string &name, T value)
Set attribute value.
void set_objs(const std::string &name, const std::vector< const ConfigObject * > &o, bool skip_non_null_check=false)
Set relationship multi-value.
void set_obj(const std::string &name, const ConfigObject *o, bool skip_non_null_check=false)
Set relationship single-value.
const std::string & UID() const noexcept