DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Interface needed by DAQ apps and services for command handling. More...
#include <CommandFacility.hpp>
Public Member Functions | |
CommandFacility (std::string) | |
virtual | ~CommandFacility () |
CommandFacility (const CommandFacility &)=delete | |
CommandFacility is not copy-constructible. | |
CommandFacility & | operator= (const CommandFacility &)=delete |
CommandFacility is not copy-assignable. | |
CommandFacility (CommandFacility &&)=delete | |
CommandFacility is not move-constructible. | |
CommandFacility & | operator= (CommandFacility &&)=delete |
CommandFacility is not move-assignable. | |
void | set_commanded (CommandedObject &commanded, std::string name) |
Meant to be called once from main. | |
virtual void | run (std::atomic< bool > &end_marker)=0 |
Meant to be called once from main (implementation specific) | |
void | execute_command (const cmdobj_t &cmd, cmd::CommandReply meta) |
Feed commands from the implementation. | |
Protected Member Functions | |
virtual void | completion_callback (const cmdobj_t &cmd, cmd::CommandReply &meta)=0 |
Must be implemented to handling the results of the commands. | |
Protected Attributes | |
std::string | m_name |
name of the commanded object | |
Private Types | |
typedef tbb::concurrent_queue< std::future< void > > | CompletionQueue |
Completion queue for reqistered tasks. | |
typedef std::function< void(const cmdobj_t &, cmd::CommandReply)> | CommandCallback |
Request callback function signature. | |
Private Member Functions | |
void | handle_command (const cmdobj_t &cmd, cmd::CommandReply meta) |
The glue between commanded and completion callback. | |
void | executor () |
Private Attributes | |
CommandedObject * | m_commanded_object = nullptr |
Commanded Object to run execute with received commands as parameters. | |
CompletionQueue | m_completion_queue |
CommandCallback | m_command_callback = nullptr |
std::atomic< bool > | m_active |
Single thrad is responsible to trigger tasks. | |
std::thread | m_executor |
Interface needed by DAQ apps and services for command handling.
Definition at line 49 of file CommandFacility.hpp.
|
private |
Request callback function signature.
Definition at line 95 of file CommandFacility.hpp.
|
private |
Completion queue for reqistered tasks.
Definition at line 91 of file CommandFacility.hpp.
|
inlineexplicit |
Definition at line 52 of file CommandFacility.hpp.
|
virtual |
Definition at line 21 of file CommandFacility.cpp.
|
delete |
CommandFacility is not copy-constructible.
|
delete |
CommandFacility is not move-constructible.
|
protectedpure virtual |
Must be implemented to handling the results of the commands.
void CommandFacility::execute_command | ( | const cmdobj_t & | cmd, |
cmd::CommandReply | meta ) |
Feed commands from the implementation.
Definition at line 46 of file CommandFacility.cpp.
|
private |
Definition at line 80 of file CommandFacility.cpp.
|
private |
The glue between commanded and completion callback.
Definition at line 53 of file CommandFacility.cpp.
|
delete |
CommandFacility is not move-assignable.
|
delete |
CommandFacility is not copy-assignable.
|
pure virtual |
Meant to be called once from main (implementation specific)
void CommandFacility::set_commanded | ( | CommandedObject & | commanded, |
std::string | name ) |
Meant to be called once from main.
Definition at line 32 of file CommandFacility.cpp.
|
private |
Single thrad is responsible to trigger tasks.
Definition at line 99 of file CommandFacility.hpp.
|
private |
Definition at line 96 of file CommandFacility.hpp.
|
mutableprivate |
Commanded Object to run execute with received commands as parameters.
Definition at line 87 of file CommandFacility.hpp.
|
private |
Definition at line 92 of file CommandFacility.hpp.
|
private |
Definition at line 101 of file CommandFacility.hpp.
|
protected |
name of the commanded object
Definition at line 77 of file CommandFacility.hpp.