44std::vector<const confmodel::DaqModule*>
50 std::vector<const confmodel::DaqModule*> modules;
53 std::vector<const conffwk::ConfigObject*> trmrOutputObjs;
60 auto destination_class = rule->get_destination_class();
61 if (destination_class ==
"TRMonRequestorModule") {
62 tdtQDesc = rule->get_descriptor();
65 if (tdtQDesc ==
nullptr) {
66 throw(BadConf(
ERS_HERE,
"Could not find queue descriptor rule for TriggerDecisionTokens!"));
74 auto descriptor = rule->get_descriptor();
75 auto data_type = descriptor->get_data_type();
76 if (data_type ==
"TriggerRecord") {
77 dwNetDesc = rule->get_descriptor();
80 if (dwNetDesc ==
nullptr) {
81 throw(BadConf(
ERS_HERE,
"Could not find network descriptor rule for input TriggerRecords!"));
88 auto sessionApps =
session->enabled_applications();
89 std::vector<conffwk::ConfigObject> trmonreqNetObjs;
90 for (
auto app : sessionApps) {
93 if (smartapp ==
nullptr || dfapp ==
nullptr) {
98 for (
auto rule : dfNRules) {
99 auto descriptor = rule->get_descriptor();
100 auto data_type = descriptor->get_data_type();
101 if (data_type ==
"TRMonRequest") {
102 trmonreqNetObjs.emplace_back(obj_fac.
create_net_obj(descriptor, smartapp->UID()));
108 for (
auto&
obj : trmonreqNetObjs) {
109 trmrOutputObjs.push_back(&
obj);
117 if (trmrConf ==
nullptr) {
118 throw(BadConf(
ERS_HERE,
"No TRMonRequestor configuration given"));
120 auto trmrConfObj = trmrConf->config_object();
122 std::string trmrUid(
UID() +
"-trmr");
124 trmrObj.
set_obj(
"configuration", &trmrConfObj);
125 trmrObj.
set_objs(
"inputs", { &tdtQueueObj });
126 trmrObj.
set_objs(
"outputs", trmrOutputObjs);
127 trmrObj.
set_obj(
"trigger_record_destination", &dwInputObj);
133 if (dwrConf ==
nullptr) {
134 throw(BadConf(
ERS_HERE,
"No DataWriterModule configuration given"));
137 auto dwrConfObj = dwrConf->config_object();
140 std::string dwrUid(fmt::format(
"{}-dw",
UID()));
142 dwrObj.
set_by_val(
"writer_identifier", fmt::format(
"{}_dw",
UID()));
143 dwrObj.
set_obj(
"configuration", &dwrConfObj);
144 dwrObj.
set_objs(
"inputs", { &dwInputObj });
145 dwrObj.
set_objs(
"outputs", { &tdtQueueObj });
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.
std::vector< const dunedaq::confmodel::DaqModule * > generate_modules(const confmodel::Session *) 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 TARGET * cast() const noexcept
Casts object to different class.
const std::string & UID() const noexcept