79 std::vector<const confmodel::DaqModule*> modules;
84 auto ti_class = ti_conf->get_template_for();
85 std::string handler_name(
"");
90 auto destination_class = rule->get_destination_class();
91 auto data_type = rule->get_descriptor()->get_data_type();
92 if (destination_class ==
"DataHandlerModule" || destination_class == ti_class) {
93 ti_inputq_desc = rule->get_descriptor();
102 auto endpoint_class = rule->get_endpoint_class();
103 auto data_type = rule->get_descriptor()->get_data_type();
105 if (data_type ==
"DataRequest") {
106 req_net_desc = rule->get_descriptor();
108 else if (data_type ==
"TASet" || data_type ==
"TCSet"){
109 tset_out_net_desc = rule->get_descriptor();
111 else if (endpoint_class ==
"DataSubscriberModule") {
113 tin_net_desc = rule->get_descriptor();
115 else if (rule->get_descriptor()->get_data_type() == tin_net_desc->
get_data_type()) {
118 throw (BadConf(
ERS_HERE,
"Have two network connections of the same data_type and the same endpoint_class"));
120 else if (tin_net_desc->
get_data_type() ==
"TriggerActivity" &&
121 rule->get_descriptor()->get_data_type() ==
"TriggerCandidate") {
123 tout_net_desc = rule->get_descriptor();
124 handler_name =
"tahandler";
126 else if (tin_net_desc->
get_data_type() ==
"TriggerCandidate" &&
127 rule->get_descriptor()->get_data_type() ==
"TriggerActivity") {
129 tout_net_desc = tin_net_desc;
130 tin_net_desc = rule->get_descriptor();
131 handler_name =
"tahandler";
134 throw (BadConf(
ERS_HERE,
"Unexpected input & output network connection descriptors provided"));
137 else if (data_type ==
"TriggerActivity" || data_type ==
"TriggerCandidate"){
138 tout_net_desc = rule->get_descriptor();
139 if (data_type ==
"TriggerActivity")
140 handler_name =
"tphandler";
142 handler_name =
"tahandler";
148 auto sessionApps =
session->get_enabled_applications();
149 std::vector<conffwk::ConfigObject> fragOutObjs;
150 for (
auto app : sessionApps) {
152 if (dfapp ==
nullptr)
156 for (
auto rule : dfNRules) {
157 auto descriptor = rule->get_descriptor();
158 auto data_type = descriptor->get_data_type();
159 if (data_type ==
"Fragment") {
161 auto frag_conn = obj_fac.
create_net_obj(descriptor, dfapp->UID());
163 fragOutObjs.push_back(frag_conn);
169 if ( req_net_desc==
nullptr) {
170 throw (BadConf(
ERS_HERE,
"No network descriptor given to receive request and send data was set"));
172 if ( tin_net_desc==
nullptr) {
173 throw (BadConf(
ERS_HERE,
"No network descriptor given to receive trigger objects"));
175 if ( tout_net_desc==
nullptr) {
176 throw (BadConf(
ERS_HERE,
"No network descriptor given to publish trigger objects"));
178 if (ti_inputq_desc ==
nullptr) {
179 throw (BadConf(
ERS_HERE,
"No data input queue descriptor given"));
190 if (tset_out_net_desc) {
196 std::vector<const conffwk::ConfigObject*> ti_output_objs;
197 for (
auto& fNet : fragOutObjs) {
198 ti_output_objs.push_back(&fNet);
200 ti_output_objs.push_back(&tout_net_obj);
201 if (tset_out_net_desc!=
nullptr) {
202 ti_output_objs.push_back(&tset_out_net_obj);
206 throw(BadConf(
ERS_HERE,
"No source_id associated with this TriggerApplication!"));
209 std::string ti_uid(handler_name +
"-" + std::to_string(source_id));
210 auto ti_obj = obj_fac.
create(ti_class, ti_uid);
212 ti_obj.
set_by_val<uint32_t>(
"source_id", source_id);
213 ti_obj.set_by_val<uint32_t>(
"detector_id", 1);
216 auto ti_conf_obj = ti_conf->config_object();
217 ti_obj.set_obj(
"module_configuration", &ti_conf_obj);
218 ti_obj.set_objs(
"inputs", {&input_queue_obj, &req_net_obj});
219 ti_obj.set_objs(
"outputs", ti_output_objs);
226 if (rdr_conf ==
nullptr) {
227 throw (BadConf(
ERS_HERE,
"No DataReaderModule configuration given"));
232 std::string reader_uid(
"data-reader-"+
UID());
233 std::string reader_class = rdr_conf->get_template_for();
234 TLOG_DEBUG(7) <<
"creating OKS configuration object for Data subscriber class " << reader_class;
235 auto reader_obj = obj_fac.
create(reader_class, reader_uid);
236 reader_obj.
set_objs(
"inputs", {&tin_net_obj} );
237 reader_obj.set_objs(
"outputs", {&input_queue_obj} );
238 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.