#include <ConfigObjectFactory.hpp>
Definition at line 31 of file ConfigObjectFactory.hpp.
◆ ConfigObjectFactory()
| dunedaq::appmodel::ConfigObjectFactory::ConfigObjectFactory |
( |
const SmartDaqApplication * | parent | ) |
|
|
explicit |
Definition at line 11 of file ConfigObjectFactory.cpp.
11 :
13 m_dbfile(parent->config_object().contained_in()),
15
16
18}
conffwk::Configuration * m_config
static void set_nolock_mode(bool nl)
◆ ~ConfigObjectFactory()
| dunedaq::appmodel::ConfigObjectFactory::~ConfigObjectFactory |
( |
| ) |
|
◆ create()
| conffwk::ConfigObject dunedaq::appmodel::ConfigObjectFactory::create |
( |
const std::string & | class_name, |
|
|
const std::string & | id ) const |
|
nodiscard |
Definition at line 26 of file ConfigObjectFactory.cpp.
27 {
30 return cfg_obj;
31}
void create(const std::string &at, const std::string &class_name, const std::string &id, ConfigObject &object)
Create new object by class name and object id.
◆ create_callback_sid_obj()
Definition at line 69 of file ConfigObjectFactory.cpp.
70{
71 std::string rdc_uid(fmt::format("{}{}", cdesc->get_uid_base(), src_id));
72 auto rdc_obj =
create(
"DataMoveCallbackConf", rdc_uid);
73
74 rdc_obj.set_by_val<std::string>("data_type", cdesc->get_data_type());
75 rdc_obj.set_by_val<uint32_t>(
"source_id",
src_id);
76
77 return rdc_obj;
78}
conffwk::ConfigObject create(const std::string &class_name, const std::string &id) const
◆ create_net_obj() [1/2]
Definition at line 106 of file ConfigObjectFactory.cpp.
106 {
108}
conffwk::ConfigObject create_net_obj(const NetworkConnectionDescriptor *ndesc, std::string uid) const
Helper function that gets a network connection config.
◆ create_net_obj() [2/2]
Helper function that gets a network connection config.
- Parameters
-
| uid | Unique ID name of the config object |
| ndesc | Network connection descriptor object |
\ret OKS configuration object for the network connection
Definition at line 90 of file ConfigObjectFactory.cpp.
91 {
92
93 auto svc_obj = ndesc->get_associated_service()->config_object();
94 std::string net_id = ndesc->get_uid_base() + app_uid;
95 auto net_obj =
create(
"NetworkConnection", net_id);
96
97 net_obj.set_by_val<std::string>("data_type", ndesc->get_data_type());
98 net_obj.set_by_val<std::string>("connection_type", ndesc->get_connection_type());
99 net_obj.set_by_val<uint32_t>("capacity", ndesc->get_capacity());
100 net_obj.set_obj("associated_service", &svc_obj);
101
102 return net_obj;
103}
◆ create_queue_obj()
Definition at line 35 of file ConfigObjectFactory.cpp.
35 {
36
37 std::string queue_uid(qdesc->get_uid_base() + uid);
38 auto queue_obj =
create(
"Queue", queue_uid);
39 queue_obj.set_by_val<std::string>("data_type", qdesc->get_data_type());
40 queue_obj.set_by_val<std::string>("queue_type", qdesc->get_queue_type());
41 queue_obj.set_by_val<uint32_t>("capacity", qdesc->get_capacity());
42
43 return queue_obj;
44}
◆ create_queue_sid_obj() [1/2]
Definition at line 62 of file ConfigObjectFactory.cpp.
63 {
65}
conffwk::ConfigObject create_queue_sid_obj(const QueueDescriptor *qdesc, uint32_t src_id) const
◆ create_queue_sid_obj() [2/2]
Definition at line 48 of file ConfigObjectFactory.cpp.
48 {
49 std::string queue_uid(fmt::format("{}{}", qdesc->get_uid_base(), src_id));
50 auto queue_obj =
create(
"QueueWithSourceId", queue_uid);
51
52 queue_obj.set_by_val<std::string>("data_type", qdesc->get_data_type());
53 queue_obj.set_by_val<std::string>("queue_type", qdesc->get_queue_type());
54 queue_obj.set_by_val<uint32_t>("capacity", qdesc->get_capacity());
55 queue_obj.set_by_val<uint32_t>(
"source_id",
src_id);
56
57 return queue_obj;
58}
◆ get_dal() [1/2]
Definition at line 82 of file ConfigObjectFactory.hpp.
82 {
84 }
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).
◆ get_dal() [2/2]
template<class T >
| const T * dunedaq::appmodel::ConfigObjectFactory::get_dal |
( |
std::string | uid | ) |
const |
|
inline |
◆ update_modules()
| void dunedaq::appmodel::ConfigObjectFactory::update_modules |
( |
const std::vector< const confmodel::DaqModule * > & | modules | ) |
|
|
inline |
Definition at line 87 of file ConfigObjectFactory.hpp.
87 {
89 if (!app->get_modules().empty()) {
91 "SmartDaqApplication contains DaqModules which would be overwritten by generated DaqModules"));
92 }
93 if (!modules.empty()) {
94 const_cast<SmartDaqApplication*>(app)->set_modules(modules);
96 }
97 }
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.
◆ m_app_uid
| std::string dunedaq::appmodel::ConfigObjectFactory::m_app_uid |
|
private |
◆ m_config
◆ m_dbfile
| std::string dunedaq::appmodel::ConfigObjectFactory::m_dbfile |
|
private |
The documentation for this class was generated from the following files: