FairMQ: Move --catch-signals logic to control plugin

* Add StealDeviceControl() API to plugin services
This commit is contained in:
Dennis Klein
2017-09-20 01:46:10 +02:00
committed by Mohammad Al-Turany
parent 7dcd09692c
commit 44a59f25a7
10 changed files with 256 additions and 209 deletions

View File

@@ -73,6 +73,7 @@ class PluginServices
InitTask,
Run,
Pause,
Resume,
Stop,
ResetTask,
ResetDevice,
@@ -118,6 +119,13 @@ class PluginServices
auto TakeDeviceControl(const std::string& controller) -> void;
struct DeviceControlError : std::runtime_error { using std::runtime_error::runtime_error; };
/// @brief Become device controller by force
/// @param controller id
///
/// Take over device controller privileges by force. Does not trigger the ReleaseDeviceControl condition!
/// This function is intended to implement override/emergency control functionality (e.g. device shutdown on SIGINT).
auto StealDeviceControl(const std::string& controller) -> void;
/// @brief Release device controller role
/// @param controller id
/// @throws fair::mq::PluginServices::DeviceControlError if passed controller id is not the current device controller.
@@ -156,8 +164,6 @@ class PluginServices
/// @param subscriber id
auto UnsubscribeFromDeviceStateChange(const std::string& subscriber) -> void { fDevice->UnsubscribeFromStateChange(subscriber); }
auto DeviceTerminated() const -> bool { return fDevice->Terminated(); }
// Config API
/// @brief Set config property