DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ConfigObjectFactory.hpp
Go to the documentation of this file.
1
10#ifndef APPMODEL_INCLUDE_OBJECTFACTORY_HPP_
11#define APPMODEL_INCLUDE_OBJECTFACTORY_HPP_
12
17
20
23
24#include <cstdint>
25#include <string>
26#include <vector>
27
28namespace dunedaq::appmodel {
29
31{
32
34 std::string m_dbfile;
35 std::string m_app_uid;
36
37public:
39
41
42 [[nodiscard]] conffwk::ConfigObject
43 create(const std::string& class_name, const std::string& id) const;
44
45 //---
46 [[nodiscard]] conffwk::ConfigObject
47 create_queue_obj(const QueueDescriptor* qdesc, std::string uid = "") const;
48
49 //---
50 [[nodiscard]] conffwk::ConfigObject
51 create_queue_sid_obj(const QueueDescriptor* qdesc, uint32_t src_id) const;
52
53 //---
54 [[nodiscard]] conffwk::ConfigObject
55 create_queue_sid_obj(const QueueDescriptor* qdesc, const confmodel::DetectorStream* stream) const;
56 //---
57
66 [[nodiscard]] conffwk::ConfigObject
67 create_net_obj(const NetworkConnectionDescriptor* ndesc, std::string uid) const;
68
69 [[nodiscard]] conffwk::ConfigObject
71
72 template<class T>
73 const T* get_dal(std::string uid) const {
74 return m_config->get<T>(uid);
75 }
76
77 template<class T>
79 return m_config->get<T>(obj);
80 }
81
82 void
83 update_modules(const std::vector<const confmodel::DaqModule*>& modules) {
85 if (!app->get_modules().empty()) {
86 throw (BadConf(ERS_HERE,
87 "SmartDaqApplication contains DaqModules which would be overwritten by generated DaqModules"));
88 }
89 if (!modules.empty()) {
90 const_cast<SmartDaqApplication*>(app)->set_modules(modules);
92 }
93 }
94
95};
96
97} // namespace dunedaq::appmodel
98
99#endif // APPMODEL_INCLUDE_OBJECTFACTORY_HPP_
#define ERS_HERE
void update_modules(const std::vector< const confmodel::DaqModule * > &modules)
conffwk::ConfigObject create_queue_sid_obj(const QueueDescriptor *qdesc, uint32_t src_id) const
ConfigObjectFactory(const SmartDaqApplication *)
conffwk::ConfigObject create_net_obj(const NetworkConnectionDescriptor *ndesc, std::string uid) const
Helper function that gets a network connection config.
const T * get_dal(conffwk::ConfigObject &obj) const
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
void get(const std::string &class_name, const std::string &id, ConfigObject &object, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
Get object by class name and object id (multi-thread safe).
void update(const std::vector< std::string > &modified, const std::vector< std::string > &removed, const std::vector< std::string > &created) noexcept
Update cache of objects in case of modification.
conffwk entry point
msgpack::object obj