mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Allow sorting StateChange callbacks
If the key of the callback is a number, it will be used to invoke callbacks with the correct ordering.
This commit is contained in:
parent
d1c99f7e15
commit
87527179bb
|
@ -310,7 +310,9 @@ try {
|
|||
|
||||
void StateMachine::SubscribeToStateChange(const string& key, function<void(const State)> callback)
|
||||
{
|
||||
static_pointer_cast<FairMQFSM>(fFsm)->fStateChangeSignalsMap.insert({key, static_pointer_cast<FairMQFSM>(fFsm)->fStateChangeSignal.connect(callback)});
|
||||
// Check if the key has a integer value as prefix, if yes, decode it.
|
||||
int i = strtol(key.c_str(), nullptr, 10);
|
||||
static_pointer_cast<FairMQFSM>(fFsm)->fStateChangeSignalsMap.insert({key, static_pointer_cast<FairMQFSM>(fFsm)->fStateChangeSignal.connect(i, callback)});
|
||||
}
|
||||
|
||||
void StateMachine::UnsubscribeFromStateChange(const string& key)
|
||||
|
|
Loading…
Reference in New Issue
Block a user