78 std::vector<const confmodel::DaqModule*> modules;
83 auto ti_class = ti_conf->get_template_for();
84 std::string handler_name(
"");
89 auto destination_class = rule->get_destination_class();
90 auto data_type = rule->get_descriptor()->get_data_type();
91 if (destination_class ==
"DataHandlerModule" || destination_class == ti_class) {
92 ti_inputq_desc = rule->get_descriptor();
101 auto endpoint_class = rule->get_endpoint_class();
102 auto data_type = rule->get_descriptor()->get_data_type();
104 if (data_type ==
"DataRequest") {
105 req_net_desc = rule->get_descriptor();
107 else if (data_type ==
"TASet" || data_type ==
"TCSet"){
108 tset_out_net_desc = rule->get_descriptor();
110 else if (endpoint_class ==
"DataSubscriberModule") {
112 tin_net_desc = rule->get_descriptor();
114 else if (rule->get_descriptor()->get_data_type() == tin_net_desc->
get_data_type()) {
117 throw (BadConf(
ERS_HERE,
"Have two network connections of the same data_type and the same endpoint_class"));
119 else if (tin_net_desc->
get_data_type() ==
"TriggerActivity" &&
120 rule->get_descriptor()->get_data_type() ==
"TriggerCandidate") {
122 tout_net_desc = rule->get_descriptor();
123 handler_name =
"tahandler";
125 else if (tin_net_desc->
get_data_type() ==
"TriggerCandidate" &&
126 rule->get_descriptor()->get_data_type() ==
"TriggerActivity") {
128 tout_net_desc = tin_net_desc;
129 tin_net_desc = rule->get_descriptor();
130 handler_name =
"tahandler";
133 throw (BadConf(
ERS_HERE,
"Unexpected input & output network connection descriptors provided"));
136 else if (data_type ==
"TriggerActivity" || data_type ==
"TriggerCandidate"){
137 tout_net_desc = rule->get_descriptor();
138 if (data_type ==
"TriggerActivity")
139 handler_name =
"tphandler";
141 handler_name =
"tahandler";
146 std::vector<conffwk::ConfigObject> fragOutObjs;
147 for (
auto [uid, descriptor]:
148 helper->get_netdescriptors(
"Fragment",
"DFApplication")) {
151 if ( req_net_desc==
nullptr) {
152 throw (BadConf(
ERS_HERE,
"No network descriptor given to receive request and send data was set"));
154 if ( tin_net_desc==
nullptr) {
155 throw (BadConf(
ERS_HERE,
"No network descriptor given to receive trigger objects"));
157 if ( tout_net_desc==
nullptr) {
158 throw (BadConf(
ERS_HERE,
"No network descriptor given to publish trigger objects"));
160 if (ti_inputq_desc ==
nullptr) {
161 throw (BadConf(
ERS_HERE,
"No data input queue descriptor given"));
172 if (tset_out_net_desc) {
178 std::vector<const conffwk::ConfigObject*> ti_output_objs;
179 for (
auto& fNet : fragOutObjs) {
180 ti_output_objs.push_back(&fNet);
182 ti_output_objs.push_back(&tout_net_obj);
183 if (tset_out_net_desc!=
nullptr) {
184 ti_output_objs.push_back(&tset_out_net_obj);
188 throw(BadConf(
ERS_HERE,
"No source_id associated with this TriggerApplication!"));
191 std::string ti_uid(handler_name +
"-" + std::to_string(source_id));
192 auto ti_obj = obj_fac.
create(ti_class, ti_uid);
194 ti_obj.
set_by_val<uint32_t>(
"source_id", source_id);
195 ti_obj.set_by_val<uint32_t>(
"detector_id", 1);
198 auto ti_conf_obj = ti_conf->config_object();
199 ti_obj.set_obj(
"module_configuration", &ti_conf_obj);
200 ti_obj.set_objs(
"inputs", {&input_queue_obj, &req_net_obj});
201 ti_obj.set_objs(
"outputs", ti_output_objs);
208 if (rdr_conf ==
nullptr) {
209 throw (BadConf(
ERS_HERE,
"No DataReaderModule configuration given"));
214 std::string reader_uid(
"data-reader-"+
UID());
215 std::string reader_class = rdr_conf->get_template_for();
216 TLOG_DEBUG(7) <<
"creating OKS configuration object for Data subscriber class " << reader_class;
217 auto reader_obj = obj_fac.
create(reader_class, reader_uid);
218 reader_obj.
set_objs(
"inputs", {&tin_net_obj} );
219 reader_obj.set_objs(
"outputs", {&input_queue_obj} );
220 reader_obj.set_obj(
"configuration", &rdr_conf->config_object());
conffwk::ConfigObject create_network_connection(std::string uid, const NetworkConnectionDescriptor *ntDesc, conffwk::Configuration *confdb, const std::string &dbfile)
Helper function that gets a network connection config.