DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
opmonlib
src
OpMonFacility.cpp
Go to the documentation of this file.
1
8
9
#include "
opmonlib/OpMonFacility.hpp
"
10
#include "
logging/Logging.hpp
"
11
12
using namespace
dunedaq::opmonlib
;
13
14
std::shared_ptr<OpMonFacility>
dunedaq::opmonlib::makeOpMonFacility
(std::string
const
& facility,
OptionalOrigin
o) {
15
16
TLOG
() <<
"FACILITY = "
<< facility;
17
18
const
std::string hook =
"://"
;
19
auto
sep = facility.find(hook);
20
std::string scheme;
21
if
(sep == std::string::npos) {
// simple path
22
scheme =
"stdout"
;
23
}
else
{
// with scheme
24
scheme = facility.substr(0, sep);
25
}
26
27
28
std::string plugin_name = scheme +
"OpMonFacility"
;
29
static
cet::BasicPluginFactory bpf(
"duneOpMonFacility"
,
"make"
);
30
std::shared_ptr<OpMonFacility> os_ptr;
31
32
try
{
33
os_ptr = bpf.makePlugin<std::shared_ptr<OpMonFacility>>(plugin_name, facility, o);
34
}
catch
(
const
ers::Issue
& iexpt) {
35
throw
OpMonFacilityCreationFailed(
ERS_HERE
, plugin_name, iexpt);
36
}
catch
(
const
cet::exception& cexpt) {
37
throw
OpMonFacilityCreationFailedWithCause(
ERS_HERE
, plugin_name, cexpt.what());
38
}
catch
(...) {
// NOLINT JCF Jan-27-2021 violates letter of the law but not the spirit
39
throw
OpMonFacilityCreationFailed(
ERS_HERE
, plugin_name);
40
}
41
return
os_ptr;
42
}
43
44
45
46
47
ERS_HERE
#define ERS_HERE
Definition
LocalContext.hpp:141
OpMonFacility.hpp
ers::Issue
Base class for any user define issue.
Definition
Issue.hpp:80
Logging.hpp
TLOG
#define TLOG(...)
Definition
macro.hpp:22
dunedaq::opmonlib
Definition
BackendOpMonFacility.hpp:11
dunedaq::opmonlib::makeOpMonFacility
std::shared_ptr< OpMonFacility > makeOpMonFacility(std::string const &facility, OptionalOrigin=OptionalOrigin())
Definition
OpMonFacility.cpp:14
dunedaq::opmonlib::OptionalOrigin
std::optional< dunedaq::opmon::OpMonId > OptionalOrigin
Definition
OpMonFacility.hpp:84
Generated on
for DUNE-DAQ by
1.17.0