DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::cmdlib Namespace Reference

Namespaces

namespace  cmd
 

Classes

class  CommandedObject
 Interface needed by commanded objects in the DAQ. More...
 
class  CommandFacility
 Interface needed by DAQ apps and services for command handling. More...
 

Functions

template<typename... ARGS>
std::shared_ptr< CommandFacilitymake_command_facility (std::string const &uri, ARGS &&... args)
 

Function Documentation

◆ make_command_facility()

template<typename... ARGS>
std::shared_ptr< CommandFacility > dunedaq::cmdlib::make_command_facility ( std::string const & uri,
ARGS &&... args )

Definition at line 106 of file CommandFacility.hpp.

109{
110 auto sep = uri.find("://");
111 std::string scheme;
112 if (sep == std::string::npos) { // simple path
113 scheme = "stdin";
114 } else { // with scheme
115 scheme = uri.substr(0, sep);
116 }
117 std::string plugin_name = scheme + "CommandFacility";
118 static cet::BasicPluginFactory bpf("duneCommandFacility", "make");
119 std::shared_ptr<CommandFacility> cf_ptr;
120 try {
121 cf_ptr = bpf.makePlugin<std::shared_ptr<CommandFacility>>(
122 plugin_name,
123 uri,
124 std::forward<ARGS>(args)...
125 );
126 } catch (const cet::exception &cexpt) {
127 throw CommandFacilityCreationFailed(ERS_HERE, uri, cexpt);
128 } catch (const ers::Issue &iexpt) {
129 throw CommandFacilityCreationFailed(ERS_HERE, uri, iexpt);
130 } catch (...) { // NOLINT JCF Jan-27-2021 violates letter of the law but not the spirit
131 throw CommandFacilityCreationFailed(ERS_HERE, uri, "Unknown error.");
132 }
133 return cf_ptr;
134}
#define ERS_HERE
Base class for any user define issue.
Definition Issue.hpp:69
Unsupported std::string uri Execution of command std::string error Failed to create CommandFacility uri
Definition Issues.hpp:77
Unsupported std::string uri Execution of command std::string error CommandFacilityCreationFailed
Definition Issues.hpp:76