41 ers::error(CommandFacilityInitialization(
ERS_HERE,
"set_commanded shall be called once."));
48 auto execfut = std::async(std::launch::deferred,
m_command_callback, std::move(cmd), std::move(meta));
65 }
catch (
const std::exception& exc) {
72 meta.
result =
"Caught unknown exception";
82 std::future<void> fut;
85 std::this_thread::sleep_for(std::chrono::milliseconds(10));
void handle_command(const cmdobj_t &cmd, cmd::CommandReply meta)
The glue between commanded and completion callback.
virtual void completion_callback(const cmdobj_t &cmd, cmd::CommandReply &meta)=0
Must be implemented to handling the results of the commands.
virtual ~CommandFacility()
CommandedObject * m_commanded_object
Commanded Object to run execute with received commands as parameters.
CompletionQueue m_completion_queue
std::string m_name
name of the commanded object
std::atomic< bool > m_active
Single thrad is responsible to trigger tasks.
CommandCallback m_command_callback
void set_commanded(CommandedObject &commanded, std::string name)
Meant to be called once from main.
void execute_command(const cmdobj_t &cmd, cmd::CommandReply meta)
Feed commands from the implementation.
Interface needed by commanded objects in the DAQ.
virtual void execute(const cmdobj_t &command)=0
Pure virtual execute member.
Base class for any user define issue.
const char * what() const noexcept
General cause of the issue.
Unsupported std::string uri CommandExecutionFailed
void error(const Issue &issue)