mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
FairMQ: Implement Take/ReleaseDeviceControl plugin API
The main function of this API is to make sure only one plugin is controlling the device state transitions at a time. The ReleaseDeviceControl() signal is used to implement a function WaitForPluginsToReleaseDeviceControl() which is used to block the main thread if a control plugin is used.
This commit is contained in:
committed by
Mohammad Al-Turany
parent
dfb2bac4bc
commit
2af3ae99eb
@@ -67,12 +67,11 @@ class Plugin
|
||||
auto ToDeviceState(const std::string& state) const -> DeviceState { return fPluginServices->ToDeviceState(state); }
|
||||
auto ToStr(DeviceState state) const -> std::string { return fPluginServices->ToStr(state); }
|
||||
auto GetCurrentDeviceState() const -> DeviceState { return fPluginServices->GetCurrentDeviceState(); }
|
||||
auto ChangeDeviceState(const DeviceStateTransition next) -> void { fPluginServices->ChangeDeviceState(next); }
|
||||
auto TakeDeviceControl() -> void { fPluginServices->TakeDeviceControl(fkName); };
|
||||
auto ReleaseDeviceControl() -> void { fPluginServices->ReleaseDeviceControl(fkName); };
|
||||
auto ChangeDeviceState(const DeviceStateTransition next) -> void { fPluginServices->ChangeDeviceState(fkName, next); }
|
||||
auto SubscribeToDeviceStateChange(std::function<void(DeviceState)> callback) -> void { fPluginServices->SubscribeToDeviceStateChange(fkName, callback); }
|
||||
auto UnsubscribeFromDeviceStateChange() -> void { fPluginServices->UnsubscribeFromDeviceStateChange(fkName); }
|
||||
auto TakeControl() -> void { fPluginServices->TakeControl(fkName); };
|
||||
auto ReleaseControl() -> void { fPluginServices->ReleaseControl(fkName); };
|
||||
|
||||
// device config API
|
||||
// see <fairmq/PluginServices.h> for docs
|
||||
template<typename T>
|
||||
|
Reference in New Issue
Block a user