mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Extract state queue into own class. Use in device, plugins
This commit is contained in:
committed by
Dennis Klein
parent
4487b81de8
commit
f515eb1100
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <fairmq/Plugin.h>
|
||||
#include <fairmq/Version.h>
|
||||
#include <fairmq/StateQueue.h>
|
||||
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
@@ -41,23 +42,17 @@ class Control : public Plugin
|
||||
static auto PrintStateMachineColor() -> void;
|
||||
static auto PrintStateMachine() -> void;
|
||||
auto StaticMode() -> void;
|
||||
auto WaitForNextState() -> DeviceState;
|
||||
auto SignalHandler() -> void;
|
||||
auto RunShutdownSequence() -> void;
|
||||
auto RunStartupSequence() -> void;
|
||||
auto EmptyEventQueue() -> void;
|
||||
|
||||
std::thread fControllerThread;
|
||||
std::thread fSignalHandlerThread;
|
||||
std::queue<DeviceState> fEvents;
|
||||
std::mutex fEventsMutex;
|
||||
std::mutex fControllerMutex;
|
||||
std::condition_variable fNewEvent;
|
||||
std::atomic<bool> fDeviceShutdownRequested;
|
||||
std::atomic<bool> fDeviceHasShutdown;
|
||||
std::atomic<bool> fPluginShutdownRequested;
|
||||
|
||||
struct DeviceErrorState : std::runtime_error { using std::runtime_error::runtime_error; };
|
||||
fair::mq::StateQueue fStateQueue;
|
||||
}; /* class Control */
|
||||
|
||||
auto ControlPluginProgramOptions() -> Plugin::ProgOptions;
|
||||
|
Reference in New Issue
Block a user