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...

Typedefs

typedef nlohmann::json cmdobj_t

Functions

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

Typedef Documentation

◆ cmdobj_t

typedef nlohmann::json dunedaq::cmdlib::cmdobj_t

Definition at line 15 of file CommandedObject.hpp.

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 99 of file CommandFacility.hpp.

100{
101 auto sep = uri.find("://");
102 std::string scheme;
103 if (sep == std::string::npos) { // simple path
104 scheme = "stdin";
105 } else { // with scheme
106 scheme = uri.substr(0, sep);
107 }
108 std::string plugin_name = scheme + "CommandFacility";
109 static cet::BasicPluginFactory bpf("duneCommandFacility", "make");
110 std::shared_ptr<CommandFacility> cf_ptr;
111 try {
112 cf_ptr = bpf.makePlugin<std::shared_ptr<CommandFacility>>(plugin_name, uri, std::forward<ARGS>(args)...);
113 } catch (const cet::exception& cexpt) {
115 } catch (const ers::Issue& iexpt) {
117 } catch (...) { // NOLINT JCF Jan-27-2021 violates letter of the law but not the spirit
118 throw CommandFacilityCreationFailed(ERS_HERE, uri, "Unknown error.");
119 }
120 return cf_ptr;
121}
#define ERS_HERE
Unsupported std::string uri Execution of command std::string error Failed to create CommandFacility uri
Definition Issues.hpp:71
Unsupported std::string uri Execution of command std::string error CommandFacilityCreationFailed
Definition Issues.hpp:70