mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Remove deprecated methods
This commit is contained in:
parent
636846fcdb
commit
ea746b17d0
|
@ -24,34 +24,6 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace fair::mq;
|
using namespace fair::mq;
|
||||||
|
|
||||||
static map<Transition, State> backwardsCompatibilityWaitForEndOfStateHelper =
|
|
||||||
{
|
|
||||||
{ Transition::InitDevice, State::InitializingDevice },
|
|
||||||
{ Transition::CompleteInit, State::Initialized },
|
|
||||||
{ Transition::Bind, State::Bound },
|
|
||||||
{ Transition::Connect, State::DeviceReady },
|
|
||||||
{ Transition::InitTask, State::Ready },
|
|
||||||
{ Transition::Run, State::Ready },
|
|
||||||
{ Transition::Stop, State::Ready },
|
|
||||||
{ Transition::ResetTask, State::DeviceReady },
|
|
||||||
{ Transition::ResetDevice, State::Idle }
|
|
||||||
};
|
|
||||||
|
|
||||||
static map<int, Transition> backwardsCompatibilityChangeStateHelper =
|
|
||||||
{
|
|
||||||
{ FairMQDevice::Event::INIT_DEVICE, Transition::InitDevice },
|
|
||||||
{ FairMQDevice::Event::internal_DEVICE_READY, Transition::Auto },
|
|
||||||
{ FairMQDevice::Event::INIT_TASK, Transition::InitTask },
|
|
||||||
{ FairMQDevice::Event::internal_READY, Transition::Auto },
|
|
||||||
{ FairMQDevice::Event::RUN, Transition::Run },
|
|
||||||
{ FairMQDevice::Event::STOP, Transition::Stop },
|
|
||||||
{ FairMQDevice::Event::RESET_TASK, Transition::ResetTask },
|
|
||||||
{ FairMQDevice::Event::RESET_DEVICE, Transition::ResetDevice },
|
|
||||||
{ FairMQDevice::Event::internal_IDLE, Transition::Auto },
|
|
||||||
{ FairMQDevice::Event::END, Transition::End },
|
|
||||||
{ FairMQDevice::Event::ERROR_FOUND, Transition::ErrorFound }
|
|
||||||
};
|
|
||||||
|
|
||||||
constexpr const char* FairMQDevice::DefaultId;
|
constexpr const char* FairMQDevice::DefaultId;
|
||||||
constexpr int FairMQDevice::DefaultIOThreads;
|
constexpr int FairMQDevice::DefaultIOThreads;
|
||||||
constexpr const char* FairMQDevice::DefaultTransportName;
|
constexpr const char* FairMQDevice::DefaultTransportName;
|
||||||
|
@ -244,16 +216,6 @@ void FairMQDevice::TransitionTo(const fair::mq::State s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FairMQDevice::ChangeState(const int transition)
|
|
||||||
{
|
|
||||||
return ChangeState(backwardsCompatibilityChangeStateHelper.at(transition));
|
|
||||||
}
|
|
||||||
|
|
||||||
void FairMQDevice::WaitForEndOfState(Transition transition)
|
|
||||||
{
|
|
||||||
WaitForState(backwardsCompatibilityWaitForEndOfStateHelper.at(transition));
|
|
||||||
}
|
|
||||||
|
|
||||||
void FairMQDevice::InitWrapper()
|
void FairMQDevice::InitWrapper()
|
||||||
{
|
{
|
||||||
// run initialization once CompleteInit transition is requested
|
// run initialization once CompleteInit transition is requested
|
||||||
|
|
|
@ -54,38 +54,6 @@ class FairMQDevice
|
||||||
friend class FairMQChannel;
|
friend class FairMQChannel;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// backwards-compatibility enum for old state machine interface, todo: delete this
|
|
||||||
enum Event
|
|
||||||
{
|
|
||||||
INIT_DEVICE,
|
|
||||||
internal_DEVICE_READY,
|
|
||||||
INIT_TASK,
|
|
||||||
internal_READY,
|
|
||||||
RUN,
|
|
||||||
STOP,
|
|
||||||
RESET_TASK,
|
|
||||||
RESET_DEVICE,
|
|
||||||
internal_IDLE,
|
|
||||||
END,
|
|
||||||
ERROR_FOUND
|
|
||||||
};
|
|
||||||
|
|
||||||
// backwards-compatibility enum for old state machine interface, todo: delete this
|
|
||||||
enum State
|
|
||||||
{
|
|
||||||
OK,
|
|
||||||
Error,
|
|
||||||
IDLE,
|
|
||||||
INITIALIZING_DEVICE,
|
|
||||||
DEVICE_READY,
|
|
||||||
INITIALIZING_TASK,
|
|
||||||
READY,
|
|
||||||
RUNNING,
|
|
||||||
RESETTING_TASK,
|
|
||||||
RESETTING_DEVICE,
|
|
||||||
EXITING
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Default constructor
|
/// Default constructor
|
||||||
FairMQDevice();
|
FairMQDevice();
|
||||||
/// Constructor with external fair::mq::ProgOptions
|
/// Constructor with external fair::mq::ProgOptions
|
||||||
|
@ -449,8 +417,6 @@ class FairMQDevice
|
||||||
/// Called in the RUNNING state once after executing the Run()/ConditionalRun() method
|
/// Called in the RUNNING state once after executing the Run()/ConditionalRun() method
|
||||||
virtual void PostRun() {}
|
virtual void PostRun() {}
|
||||||
|
|
||||||
virtual void Pause() __attribute__((deprecated("PAUSE state is removed. This method is never called. To pause Run, go to READY with STOP transition and back to RUNNING with RUN to resume."))) {}
|
|
||||||
|
|
||||||
/// Resets the user task (to be overloaded in child classes)
|
/// Resets the user task (to be overloaded in child classes)
|
||||||
virtual void ResetTask() {}
|
virtual void ResetTask() {}
|
||||||
|
|
||||||
|
@ -461,11 +427,6 @@ class FairMQDevice
|
||||||
bool ChangeState(const fair::mq::Transition transition) { return fStateMachine.ChangeState(transition); }
|
bool ChangeState(const fair::mq::Transition transition) { return fStateMachine.ChangeState(transition); }
|
||||||
bool ChangeState(const std::string& transition) { return fStateMachine.ChangeState(fair::mq::GetTransition(transition)); }
|
bool ChangeState(const std::string& transition) { return fStateMachine.ChangeState(fair::mq::GetTransition(transition)); }
|
||||||
|
|
||||||
bool ChangeState(const int transition) __attribute__((deprecated("Use ChangeState(const fair::mq::Transition transition).")));
|
|
||||||
|
|
||||||
void WaitForEndOfState(const fair::mq::Transition transition) __attribute__((deprecated("Use WaitForState(fair::mq::State expectedState).")));
|
|
||||||
void WaitForEndOfState(const std::string& transition) __attribute__((deprecated("Use WaitForState(fair::mq::State expectedState)."))) { WaitForState(transition); }
|
|
||||||
|
|
||||||
fair::mq::State WaitForNextState() { return fStateQueue.WaitForNext(); }
|
fair::mq::State WaitForNextState() { return fStateQueue.WaitForNext(); }
|
||||||
void WaitForState(fair::mq::State state) { fStateQueue.WaitForState(state); }
|
void WaitForState(fair::mq::State state) { fStateQueue.WaitForState(state); }
|
||||||
void WaitForState(const std::string& state) { WaitForState(fair::mq::GetState(state)); }
|
void WaitForState(const std::string& state) { WaitForState(fair::mq::GetState(state)); }
|
||||||
|
@ -478,9 +439,6 @@ class FairMQDevice
|
||||||
void SubscribeToNewTransition(const std::string& key, std::function<void(const fair::mq::Transition)> callback) { fStateMachine.SubscribeToNewTransition(key, callback); }
|
void SubscribeToNewTransition(const std::string& key, std::function<void(const fair::mq::Transition)> callback) { fStateMachine.SubscribeToNewTransition(key, callback); }
|
||||||
void UnsubscribeFromNewTransition(const std::string& key) { fStateMachine.UnsubscribeFromNewTransition(key); }
|
void UnsubscribeFromNewTransition(const std::string& key) { fStateMachine.UnsubscribeFromNewTransition(key); }
|
||||||
|
|
||||||
bool CheckCurrentState(const int /* state */) const __attribute__((deprecated("Use NewStatePending()."))) { return !fStateMachine.NewStatePending(); }
|
|
||||||
bool CheckCurrentState(const std::string& /* state */) const __attribute__((deprecated("Use NewStatePending()."))) { return !fStateMachine.NewStatePending(); }
|
|
||||||
|
|
||||||
/// Returns true is a new state has been requested, signaling the current handler to stop.
|
/// Returns true is a new state has been requested, signaling the current handler to stop.
|
||||||
bool NewStatePending() const { return fStateMachine.NewStatePending(); }
|
bool NewStatePending() const { return fStateMachine.NewStatePending(); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user