DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
conffwk
include
conffwk
DalFactory.hpp
Go to the documentation of this file.
1
#ifndef DAL_FACTORY_H
2
#define DAL_FACTORY_H
3
4
#include <map>
5
#include <mutex>
6
#include <string>
7
8
#include "
ers/ers.hpp
"
9
10
#include "
conffwk/set.hpp
"
11
#include "
conffwk/DalFactoryFunctions.hpp
"
12
13
#include "
logging/Logging.hpp
"
14
15
namespace
dunedaq
{
16
17
ERS_DECLARE_ISSUE
(
conffwk
, DalPackageNameNotFound,
18
"Failed to find the dal package name for class "
<< class_name <<
" in its schema path '"
<< schema_path <<
"'"
,
19
((std::string)class_name)((std::string)schema_path))
20
21
ERS_DECLARE_ISSUE
(
conffwk
,
LoadDalFailed
,
22
"Could not load dal shared library "
<< library,
23
((
std
::
string
)library))
24
25
namespace
conffwk
{
26
27
class
DalObject;
28
class
DalRegistry;
29
30
class
DalFactory
31
{
32
33
typedef
std::function<DalObject *(DalRegistry& db, ConfigObject&
obj
)> dal_object_instatiator_2g;
34
35
public
:
36
38
static
DalFactory &
39
instance();
40
41
// /** register DAL object creator by class name*/
42
// template<class T>
43
// void
44
// register_dal_class(const std::string & name, const std::set<std::string>& algorithms);
45
47
template
<
class
T>
48
void
49
register_dal_class(
const
std::string & name);
50
51
const
std::string&
52
get_known_class_name_ref(
const
std::string& name);
53
65
66
DalObject *
67
get(Configuration& db, ConfigObject&
obj
,
const
std::string& uid,
bool
upcast_unregistered)
const
;
68
69
DalObject *
70
get(Configuration& db, ConfigObject&
obj
,
const
std::string& uid,
const
std::string& class_name)
const
;
71
72
81
82
const
DalFactoryFunctions&
83
functions(Configuration& db,
const
std::string& name,
bool
upcast_unregistered);
84
85
86
const
std::string&
87
class4algo(Configuration& db,
const
std::string& name,
const
std::string&
algorithm
)
const
;
88
95
96
const
DalFactoryFunctions&
97
functions(
const
std::string& name)
const
;
98
99
103
conffwk::DalObject
* make(
conffwk::DalRegistry
& db,
conffwk::ConfigObject
& o,
bool
upcast_unregistered);
104
105
conffwk::DalObject
* make(
conffwk::DalRegistry
& db,
conffwk::ConfigObject
& o,
const
std::string& fallback_class=
""
);
106
107
private
:
108
109
std::mutex m_class_mutex;
110
std::map<std::string, DalFactoryFunctions> m_classes;
111
112
// std::map<std::string, dal_object_instatiator> m_instantiators;
113
std::map<std::string, dal_object_instatiator_2g> m_creators;
114
115
std::mutex m_known_class_mutex;
116
conffwk::set
m_known_classes;
117
118
// Move into a dedicated class/function
119
bool
try_load_class_library(Configuration& db,
const
std::string& class_name);
120
};
121
122
}
// namespace conffwk
123
}
// namespace dunedaq
124
125
126
#include "
details/DalFactory.hxx
"
127
128
#endif
DalFactoryFunctions.hpp
DalFactory.hxx
algorithm
algorithm
Definition
TriggerActivity_serialization.hpp:49
dunedaq::conffwk::DalObject
The base class for any generated DAL object.
Definition
DalObject.hpp:52
dunedaq::conffwk::DalRegistry
DalRegistry: A registry of DalObjects It provides a single interface to create, cache and manage DalO...
Definition
DalRegistry.hpp:19
ers.hpp
Logging.hpp
ERS_DECLARE_ISSUE
#define ERS_DECLARE_ISSUE( namespace_name, class_name, message_, attributes)
Definition
macro.hpp:65
conffwk.ConfigObject
Definition
ConfigObject.py:1
conffwk
Definition
__init__.py:1
dunedaq::conffwk::set
std::unordered_set< std::string > set
Definition
set.hpp:17
dunedaq
Including Qt Headers.
Definition
module.cpp:16
dunedaq::LoadDalFailed
LoadDalFailed
Definition
DalFactory.hpp:21
dunedaq::obj
msgpack::object obj
Definition
Serialization.hpp:257
dunedaq::ERS_DECLARE_ISSUE
ERS_DECLARE_ISSUE(snbmodules, InvalidGroupTransferIDError, "InvalidGroupTransferIDError: Transfer ID "<< transfer_id<< " not found in "<< location,((std::string) transfer_id)((std::string) location)) ERS_DECLARE_ISSUE(snbmodules
std
Definition
SchemaUtils.hpp:118
set.hpp
Generated on
for DUNE-DAQ by
1.17.0