From e3cb1dd9e5430e0110c8d220369f3ea68c48eff0 Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Thu, 5 Oct 2017 09:30:40 +0200 Subject: [PATCH] FairMQ: remove runSimpleMQStateMachine (now via control plugin). --- fairmq/CMakeLists.txt | 1 - fairmq/runFairMQDevice.h | 19 -------- fairmq/tools/runSimpleMQStateMachine.h | 66 -------------------------- 3 files changed, 86 deletions(-) delete mode 100644 fairmq/tools/runSimpleMQStateMachine.h diff --git a/fairmq/CMakeLists.txt b/fairmq/CMakeLists.txt index d6074d93..409b8609 100644 --- a/fairmq/CMakeLists.txt +++ b/fairmq/CMakeLists.txt @@ -105,7 +105,6 @@ set(FAIRMQ_HEADER_FILES shmem/FairMQShmCommon.h tools/CppSTL.h tools/Network.h - tools/runSimpleMQStateMachine.h tools/Strings.h tools/Version.h zeromq/FairMQMessageZMQ.h diff --git a/fairmq/runFairMQDevice.h b/fairmq/runFairMQDevice.h index 9c7f3eff..7d19362e 100644 --- a/fairmq/runFairMQDevice.h +++ b/fairmq/runFairMQDevice.h @@ -11,25 +11,6 @@ #include #include -template -class GenericFairMQDevice : public FairMQDevice -{ - public: - GenericFairMQDevice(R func) : r(func) {} - - protected: - virtual bool ConditionalRun() { return r(*static_cast(this)); } - - private: - R r; -}; - -template -FairMQDevice* makeDeviceWithConditionalRun(R r) -{ - return new GenericFairMQDevice(r); -} - using FairMQDevicePtr = FairMQDevice*; // to be implemented by the user to return a child class of FairMQDevice diff --git a/fairmq/tools/runSimpleMQStateMachine.h b/fairmq/tools/runSimpleMQStateMachine.h deleted file mode 100644 index e82b0b74..00000000 --- a/fairmq/tools/runSimpleMQStateMachine.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * File: runSimpleMQStateMachine.h - * Author: winckler - * - * Created on July 2, 2015, 2:07 PM - */ - -#ifndef RUNSIMPLEMQSTATEMACHINE_H -#define RUNSIMPLEMQSTATEMACHINE_H - -#include "FairMQLogger.h" -#include "options/FairMQParser.h" -#include "options/FairMQProgOptions.h" -#include -#include - -#include -#include -#include -#include - -// template function that takes any device -// and runs a simple MQ state machine configured from a JSON file and/or a plugin. -template -int runStateMachine(TMQDevice& device, FairMQProgOptions& cfg) -{ - std::string config = cfg.GetValue("config"); - std::string control = cfg.GetValue("control"); - - device.ChangeState(TMQDevice::INIT_DEVICE); - device.WaitForEndOfState(TMQDevice::INIT_DEVICE); - - device.ChangeState(TMQDevice::INIT_TASK); - device.WaitForEndOfState(TMQDevice::INIT_TASK); - - device.ChangeState(TMQDevice::RUN); - - if (control == "interactive") - { - LOG(ERROR) << "interactive control moved to plugin"; - return 1; - // device.InteractiveStateLoop(); - } - else if (control == "static") - { - device.WaitForEndOfState(TMQDevice::RUN); - - if (!device.CheckCurrentState(TMQDevice::EXITING)) - { - device.ChangeState(TMQDevice::RESET_TASK); - device.WaitForEndOfState(TMQDevice::RESET_TASK); - - device.ChangeState(TMQDevice::RESET_DEVICE); - device.WaitForEndOfState(TMQDevice::RESET_DEVICE); - - device.ChangeState(TMQDevice::END); - } - } - else - { - } - - return 0; -} - -#endif /* RUNSIMPLEMQSTATEMACHINE_H */