34std::vector<std::pair<std::string, const appmodel::NetworkConnectionDescriptor*>>
36 const std::string& data_type,
37 const std::string& app_class) {
38 std::vector<std::pair<std::string, const appmodel::NetworkConnectionDescriptor*>>
41 if (app_class.empty() || app->castable(app_class)) {
43 if (smart_app ==
nullptr) {
47 for (
auto rule: smart_app->get_network_rules()) {
48 auto desc = rule->get_descriptor();
49 if (desc->get_data_type() == data_type) {
50 result.emplace_back(std::pair{app->UID(), desc});
60 std::string app_class,
61 std::string data_type)
63 std::vector<const confmodel::Service*> result;
65 if (app->castable(app_class)) {
67 if (smart_app ==
nullptr) {
68 throw (NotSmart(
ERS_HERE, app->full_name()));
70 for (
auto rule: smart_app->get_network_rules()) {
71 if (rule->get_descriptor()->get_data_type() == data_type) {
72 result.push_back(rule->get_descriptor()->get_associated_service());
82 std::map<std::string,std::vector<uint32_t>> result;
85 if (ro_app !=
nullptr) {
86 std::vector<uint32_t> streams;
87 for (
auto res: ro_app->contained_resources()) {
91 throw (BadD2d(
ERS_HERE, app->full_name(), res->full_name()));
93 for (
auto stream: d2d->streams()) {
95 streams.push_back(stream->get_source_id());
100 result.insert(std::pair{app->UID(), streams});
104 if (fake_app !=
nullptr) {
105 std::vector<uint32_t> streams;
106 for (
auto res: fake_app->contained_resources()) {
109 if (fdpc !=
nullptr && !fdpc->is_disabled(*
m_session)) {
110 streams.push_back(fdpc->get_source_id());
114 result.insert(std::pair(app->UID(), streams));
121std::map<std::string, std::vector<const SourceIDConf*>>
123 std::map<std::string, std::vector<const SourceIDConf*>> result;
126 if (ro_app !=
nullptr) {
127 if (ro_app->get_tp_generation_enabled()) {
128 result.insert(std::pair(app->UID(), ro_app->get_tp_source_ids()));
131 result.insert({app->UID(), std::vector<const SourceIDConf*>()});
135 if (replay_app !=
nullptr) {
136 result.insert(std::pair(app->UID(), replay_app->get_tp_source_ids()));
143 std::string app_class){
144 std::vector<std::string> result;
146 if (app_class.empty() || app->castable(app_class)) {
147 result.push_back(app->UID());
153std::map<std::string, const SourceIDConf*>
155 std::map<std::string, const SourceIDConf*> result;
157 if (app_class.empty() || app->castable(app_class)) {
159 if (smart_app !=
nullptr && smart_app->get_source_id() !=
nullptr) {
160 result.insert({app->UID(), smart_app->get_source_id()});
168std::map<std::string, std::map<std::string, const SourceIDConf*>>
170 std::map<std::string, std::map<std::string, const SourceIDConf*>> result;
172 if (app_class.empty() || app->castable(app_class)) {
173 auto class_info = app->configuration().get_class_info(app->class_name());
174 auto obj = app->config_object();
175 for (
auto rel: class_info.p_relationships) {
176 if (rel.p_type ==
"SourceIDConf") {
180 obj.
get(rel.p_name, rel_obj);
182 if (!result.contains(app->UID())) {
183 result.insert({app->UID(), {}});
185 const auto srcid = app->configuration().get<
SourceIDConf>(rel_obj);
186 result.at(app->UID()).insert({rel.p_name, srcid});
199 if (res ==
nullptr) {
std::vector< std::string > get_app_uids(std::string app_class="")
Get list of uids of applications that match given type.
std::map< std::string, const SourceIDConf * > get_app_source_ids(std::string app_class="")
Get list of source ids for applications that match given type.
const confmodel::Session * m_session
std::map< std::string, std::map< std::string, const SourceIDConf * > > get_all_app_source_ids(std::string app_class="")
Get list of all source ids for applications that match given type. Follows any single value SourceIDC...
bool is_disabled(const conffwk::DalObject *item)
Check the enabled state of the given item.
std::map< std::string, std::vector< uint32_t > > get_stream_source_ids()
Get the source ids of all DetectorStreams in the Session.
std::map< std::string, std::vector< const SourceIDConf * > > get_tp_source_ids()
Get the source ids of all the TP streams in all ReadoutApplications and TriggerApplications.
std::vector< const confmodel::Service * > get_services(std::string app_class, std::string data_type)
Get the exposed Services of all network connections with given data_type from all smart daq applicati...
std::vector< std::pair< std::string, const appmodel::NetworkConnectionDescriptor * > > get_netdescriptors(const std::string &data_type, const std::string &app_class="")
Get all NetworkConnectionDescriptors with given data_type from all applications of given type.
Represents database objects.
void get(const std::string &name, T &value)
Get value of object's attribute or relationship.
bool is_null() const noexcept
Check if object's implementation points to null.
The base class for any generated DAL object.
const TARGET * cast() const noexcept
Casts object to different class.
bool is_disabled(const dunedaq::confmodel::ResourceTree &session) const
std::vector< const dunedaq::confmodel::Application * > enabled_applications() const