FairMQ: Implement property change event config API

Replaced the old event manager implementation, which changed the
subscription semantics to bulk event subscriptions.
This commit is contained in:
Dennis Klein
2017-09-28 21:51:42 +02:00
committed by Mohammad Al-Turany
parent 8c8ee45914
commit 7f23a70670
7 changed files with 95 additions and 213 deletions

View File

@@ -91,10 +91,10 @@ class Plugin
auto GetPropertyAsString(const std::string& key) const -> std::string { return fPluginServices->GetPropertyAsString(key); }
auto GetChannelInfo() const -> std::unordered_map<std::string, int> { return fPluginServices->GetChannelInfo(); }
auto GetPropertyKeys() const -> std::vector<std::string> { return fPluginServices->GetPropertyKeys(); }
// template<typename T>
// auto SubscribeToPropertyChange(std::function<void(const std::string& [>key*/, const T /*newValue<])> callback) const -> void { fPluginServices.SubscribeToPropertyChange(fkName, callback); }
// template<typename T>
// auto UnsubscribeFromPropertyChange() -> void { fPluginServices.UnsubscribeFromPropertyChange<T>(fkName); }
template<typename T>
auto SubscribeToPropertyChange(std::function<void(const std::string& key, T newValue)> callback) -> void { fPluginServices->SubscribeToPropertyChange<T>(fkName, callback); }
template<typename T>
auto UnsubscribeFromPropertyChange() -> void { fPluginServices->UnsubscribeFromPropertyChange<T>(fkName); }
private:
const std::string fkName;