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
15
17
19#include "confmodel/Service.hpp"
20#include "oks/file.hpp"
21
22#include <fmt/core.h> // Replace with std::format when we switch to a newer compiler?
23
24namespace dunedaq::appmodel {
25
27{
28
30 std::string m_dbfile;
31 std::string m_app_uid;
32
33public:
34 ConfigObjectFactory(conffwk::Configuration* config, const std::string& dbfile, const std::string& app_uid);
36
38
39 [[nodiscard]] conffwk::ConfigObject
40 create(const std::string& class_name, const std::string& id) const;
41
42 //---
43 [[nodiscard]] conffwk::ConfigObject
44 create_queue_obj(const QueueDescriptor* qdesc, std::string uid = "") const;
45
46 //---
47 [[nodiscard]] conffwk::ConfigObject
48 create_queue_sid_obj(const QueueDescriptor* qdesc, uint32_t src_id) const;
49
50 //---
51 [[nodiscard]] conffwk::ConfigObject
52 create_queue_sid_obj(const QueueDescriptor* qdesc, const confmodel::DetectorStream* stream) const;
53 //---
54
63 [[nodiscard]] conffwk::ConfigObject
64 create_net_obj(const NetworkConnectionDescriptor* ndesc, std::string uid) const;
65
66 [[nodiscard]] conffwk::ConfigObject
68
69 template<class T>
70 const T* get_dal(std::string uid) const {
71 return m_config->get<T>(uid);
72 }
73
74 template<class T>
75 const T* get_dal(conffwk::ConfigObject& obj) const {
76 return m_config->get<T>(obj);
77 }
78};
79
80} // namespace dunedaq::appmodel
81
82#endif // APPMODEL_INCLUDE_OBJECTFACTORY_HPP_
conffwk::ConfigObject create_queue_sid_obj(const QueueDescriptor *qdesc, uint32_t src_id) const
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
ConfigObjectFactory(conffwk::Configuration *config, const std::string &dbfile, const std::string &app_uid)
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).
The base class for any generated DAL object.
Definition DalObject.hpp:45
conffwk entry point