From aa4cad74820faf42144e8c1b174b29ce851192e0 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 26 Jul 2019 14:17:27 +0200 Subject: [PATCH] Replace std::shared_ptr with Expression::Ptr refs #7361 --- lib/config/applyrule.cpp | 14 +++++------ lib/config/applyrule.hpp | 20 ++++++++-------- lib/config/config_parser.yy | 2 +- lib/config/configcompiler.cpp | 4 ++-- lib/config/configcompiler.hpp | 8 +++---- lib/config/configitem.cpp | 8 +++---- lib/config/configitem.hpp | 12 +++++----- lib/config/configitembuilder.cpp | 4 ++-- lib/config/configitembuilder.hpp | 4 ++-- lib/config/expression.cpp | 10 ++++---- lib/config/expression.hpp | 41 +++++++++++++++++--------------- lib/config/vmops.hpp | 16 ++++++------- lib/remote/eventqueue.cpp | 8 +++---- lib/remote/eventqueue.hpp | 10 ++++---- 14 files changed, 82 insertions(+), 79 deletions(-) diff --git a/lib/config/applyrule.cpp b/lib/config/applyrule.cpp index f7b7cbdd2..5042eb6b6 100644 --- a/lib/config/applyrule.cpp +++ b/lib/config/applyrule.cpp @@ -9,8 +9,8 @@ using namespace icinga; ApplyRule::RuleMap ApplyRule::m_Rules; ApplyRule::TypeMap ApplyRule::m_Types; -ApplyRule::ApplyRule(String targetType, String name, std::shared_ptr expression, - std::shared_ptr filter, String package, String fkvar, String fvvar, std::shared_ptr fterm, +ApplyRule::ApplyRule(String targetType, String name, Expression::Ptr expression, + Expression::Ptr filter, String package, String fkvar, String fvvar, Expression::Ptr fterm, bool ignoreOnError, DebugInfo di, Dictionary::Ptr scope) : m_TargetType(std::move(targetType)), m_Name(std::move(name)), m_Expression(std::move(expression)), m_Filter(std::move(filter)), m_Package(std::move(package)), m_FKVar(std::move(fkvar)), m_FVVar(std::move(fvvar)), m_FTerm(std::move(fterm)), m_IgnoreOnError(ignoreOnError), m_DebugInfo(std::move(di)), m_Scope(std::move(scope)), m_HasMatches(false) @@ -26,12 +26,12 @@ String ApplyRule::GetName() const return m_Name; } -std::shared_ptr ApplyRule::GetExpression() const +Expression::Ptr ApplyRule::GetExpression() const { return m_Expression; } -std::shared_ptr ApplyRule::GetFilter() const +Expression::Ptr ApplyRule::GetFilter() const { return m_Filter; } @@ -51,7 +51,7 @@ String ApplyRule::GetFVVar() const return m_FVVar; } -std::shared_ptr ApplyRule::GetFTerm() const +Expression::Ptr ApplyRule::GetFTerm() const { return m_FTerm; } @@ -72,8 +72,8 @@ Dictionary::Ptr ApplyRule::GetScope() const } void ApplyRule::AddRule(const String& sourceType, const String& targetType, const String& name, - const std::shared_ptr& expression, const std::shared_ptr& filter, const String& package, const String& fkvar, - const String& fvvar, const std::shared_ptr& fterm, bool ignoreOnError, const DebugInfo& di, const Dictionary::Ptr& scope) + const Expression::Ptr& expression, const Expression::Ptr& filter, const String& package, const String& fkvar, + const String& fvvar, const Expression::Ptr& fterm, bool ignoreOnError, const DebugInfo& di, const Dictionary::Ptr& scope) { m_Rules[sourceType].push_back(ApplyRule(targetType, name, expression, filter, package, fkvar, fvvar, fterm, ignoreOnError, di, scope)); } diff --git a/lib/config/applyrule.hpp b/lib/config/applyrule.hpp index bc4868b9e..303b259e1 100644 --- a/lib/config/applyrule.hpp +++ b/lib/config/applyrule.hpp @@ -21,12 +21,12 @@ public: String GetTargetType() const; String GetName() const; - std::shared_ptr GetExpression() const; - std::shared_ptr GetFilter() const; + Expression::Ptr GetExpression() const; + Expression::Ptr GetFilter() const; String GetPackage() const; String GetFKVar() const; String GetFVVar() const; - std::shared_ptr GetFTerm() const; + Expression::Ptr GetFTerm() const; bool GetIgnoreOnError() const; DebugInfo GetDebugInfo() const; Dictionary::Ptr GetScope() const; @@ -35,8 +35,8 @@ public: bool EvaluateFilter(ScriptFrame& frame) const; - static void AddRule(const String& sourceType, const String& targetType, const String& name, const std::shared_ptr& expression, - const std::shared_ptr& filter, const String& package, const String& fkvar, const String& fvvar, const std::shared_ptr& fterm, + static void AddRule(const String& sourceType, const String& targetType, const String& name, const Expression::Ptr& expression, + const Expression::Ptr& filter, const String& package, const String& fkvar, const String& fvvar, const Expression::Ptr& fterm, bool ignoreOnError, const DebugInfo& di, const Dictionary::Ptr& scope); static std::vector& GetRules(const String& type); @@ -50,12 +50,12 @@ public: private: String m_TargetType; String m_Name; - std::shared_ptr m_Expression; - std::shared_ptr m_Filter; + Expression::Ptr m_Expression; + Expression::Ptr m_Filter; String m_Package; String m_FKVar; String m_FVVar; - std::shared_ptr m_FTerm; + Expression::Ptr m_FTerm; bool m_IgnoreOnError; DebugInfo m_DebugInfo; Dictionary::Ptr m_Scope; @@ -64,8 +64,8 @@ private: static TypeMap m_Types; static RuleMap m_Rules; - ApplyRule(String targetType, String name, std::shared_ptr expression, - std::shared_ptr filter, String package, String fkvar, String fvvar, std::shared_ptr fterm, + ApplyRule(String targetType, String name, Expression::Ptr expression, + Expression::Ptr filter, String package, String fkvar, String fvvar, Expression::Ptr fterm, bool ignoreOnError, DebugInfo di, Dictionary::Ptr scope); }; diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy index f1fcf4f7f..83a48758a 100644 --- a/lib/config/config_parser.yy +++ b/lib/config/config_parser.yy @@ -596,7 +596,7 @@ lterm: T_LIBRARY rterm } | T_USING rterm { - std::shared_ptr expr{$2}; + Expression::Ptr expr{$2}; context->AddImport(expr); $$ = MakeLiteralRaw(); } diff --git a/lib/config/configcompiler.cpp b/lib/config/configcompiler.cpp index 8f450994f..59285eac4 100644 --- a/lib/config/configcompiler.cpp +++ b/lib/config/configcompiler.cpp @@ -345,12 +345,12 @@ bool ConfigCompiler::IsAbsolutePath(const String& path) #endif /* _WIN32 */ } -void ConfigCompiler::AddImport(const std::shared_ptr& import) +void ConfigCompiler::AddImport(const Expression::Ptr& import) { m_Imports.push_back(import); } -std::vector > ConfigCompiler::GetImports() const +std::vector ConfigCompiler::GetImports() const { return m_Imports; } diff --git a/lib/config/configcompiler.hpp b/lib/config/configcompiler.hpp index b89fdf05c..65acf8ea2 100644 --- a/lib/config/configcompiler.hpp +++ b/lib/config/configcompiler.hpp @@ -92,8 +92,8 @@ public: void SetPackage(const String& package); String GetPackage() const; - void AddImport(const std::shared_ptr& import); - std::vector > GetImports() const; + void AddImport(const Expression::Ptr& import); + std::vector GetImports() const; static void CollectIncludes(std::vector >& expressions, const String& file, const String& zone, const String& package); @@ -114,13 +114,13 @@ public: static bool HasZoneConfigAuthority(const String& zoneName); private: - std::promise > m_Promise; + std::promise m_Promise; String m_Path; std::istream *m_Input; String m_Zone; String m_Package; - std::vector > m_Imports; + std::vector m_Imports; void *m_Scanner; diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp index 5c9f0dd55..6dbb41f59 100644 --- a/lib/config/configitem.cpp +++ b/lib/config/configitem.cpp @@ -47,8 +47,8 @@ REGISTER_FUNCTION(Internal, run_with_activation_context, &ConfigItem::RunWithAct * @param debuginfo Debug information. */ ConfigItem::ConfigItem(Type::Ptr type, String name, - bool abstract, std::shared_ptr exprl, - std::shared_ptr filter, bool defaultTmpl, bool ignoreOnError, + bool abstract, Expression::Ptr exprl, + Expression::Ptr filter, bool defaultTmpl, bool ignoreOnError, DebugInfo debuginfo, Dictionary::Ptr scope, String zone, String package) : m_Type(std::move(type)), m_Name(std::move(name)), m_Abstract(abstract), @@ -124,7 +124,7 @@ ConfigObject::Ptr ConfigItem::GetObject() const * * @returns The expression list. */ -std::shared_ptr ConfigItem::GetExpression() const +Expression::Ptr ConfigItem::GetExpression() const { return m_Expression; } @@ -134,7 +134,7 @@ std::shared_ptr ConfigItem::GetExpression() const * * @returns The filter expression. */ -std::shared_ptr ConfigItem::GetFilter() const +Expression::Ptr ConfigItem::GetFilter() const { return m_Filter; } diff --git a/lib/config/configitem.hpp b/lib/config/configitem.hpp index 0b7ee86a3..7b765491d 100644 --- a/lib/config/configitem.hpp +++ b/lib/config/configitem.hpp @@ -24,8 +24,8 @@ public: DECLARE_PTR_TYPEDEFS(ConfigItem); ConfigItem(Type::Ptr type, String name, bool abstract, - std::shared_ptr exprl, - std::shared_ptr filter, + Expression::Ptr exprl, + Expression::Ptr filter, bool defaultTmpl, bool ignoreOnError, DebugInfo debuginfo, Dictionary::Ptr scope, String zone, String package); @@ -38,8 +38,8 @@ public: std::vector GetParents() const; - std::shared_ptr GetExpression() const; - std::shared_ptr GetFilter() const; + Expression::Ptr GetExpression() const; + Expression::Ptr GetFilter() const; void Register(); void Unregister(); @@ -68,8 +68,8 @@ private: String m_Name; /**< The name. */ bool m_Abstract; /**< Whether this is a template. */ - std::shared_ptr m_Expression; - std::shared_ptr m_Filter; + Expression::Ptr m_Expression; + Expression::Ptr m_Filter; bool m_DefaultTmpl; bool m_IgnoreOnError; DebugInfo m_DebugInfo; /**< Debug information. */ diff --git a/lib/config/configitembuilder.cpp b/lib/config/configitembuilder.cpp index 6a64c76a8..f7a3eadec 100644 --- a/lib/config/configitembuilder.cpp +++ b/lib/config/configitembuilder.cpp @@ -48,7 +48,7 @@ void ConfigItemBuilder::AddExpression(Expression *expr) m_Expressions.emplace_back(expr); } -void ConfigItemBuilder::SetFilter(const std::shared_ptr& filter) +void ConfigItemBuilder::SetFilter(const Expression::Ptr& filter) { m_Filter = filter; } @@ -111,7 +111,7 @@ ConfigItem::Ptr ConfigItemBuilder::Compile() dexpr->MakeInline(); exprs.emplace_back(dexpr); - std::shared_ptr exprl = std::make_shared(std::move(exprs), m_DebugInfo); + auto exprl = new DictExpression(std::move(exprs), m_DebugInfo); exprl->MakeInline(); return new ConfigItem(m_Type, m_Name, m_Abstract, exprl, m_Filter, diff --git a/lib/config/configitembuilder.hpp b/lib/config/configitembuilder.hpp index 792e351b7..9d2e3392f 100644 --- a/lib/config/configitembuilder.hpp +++ b/lib/config/configitembuilder.hpp @@ -35,7 +35,7 @@ public: void SetIgnoreOnError(bool ignoreOnError); void AddExpression(Expression *expr); - void SetFilter(const std::shared_ptr& filter); + void SetFilter(const Expression::Ptr& filter); ConfigItem::Ptr Compile(); @@ -44,7 +44,7 @@ private: String m_Name; /**< The name. */ bool m_Abstract{false}; /**< Whether the item is abstract. */ std::vector > m_Expressions; /**< Expressions for this item. */ - std::shared_ptr m_Filter; /**< Filter expression. */ + Expression::Ptr m_Filter; /**< Filter expression. */ DebugInfo m_DebugInfo; /**< Debug information. */ Dictionary::Ptr m_Scope; /**< variable scope. */ String m_Zone; /**< The zone. */ diff --git a/lib/config/expression.cpp b/lib/config/expression.cpp index 93d3dfa98..1ae75fd3f 100644 --- a/lib/config/expression.cpp +++ b/lib/config/expression.cpp @@ -100,13 +100,13 @@ const DebugInfo& DebuggableExpression::GetDebugInfo() const return m_DebugInfo; } -VariableExpression::VariableExpression(String variable, std::vector > imports, const DebugInfo& debugInfo) +VariableExpression::VariableExpression(String variable, std::vector imports, const DebugInfo& debugInfo) : DebuggableExpression(debugInfo), m_Variable(std::move(variable)), m_Imports(std::move(imports)) { - m_Imports.push_back(MakeIndexer(ScopeGlobal, "System")); - m_Imports.push_back(std::unique_ptr(new IndexerExpression(MakeIndexer(ScopeGlobal, "System"), MakeLiteral("Configuration")))); - m_Imports.push_back(MakeIndexer(ScopeGlobal, "Types")); - m_Imports.push_back(MakeIndexer(ScopeGlobal, "Icinga")); + m_Imports.push_back(MakeIndexer(ScopeGlobal, "System").release()); + m_Imports.push_back(new IndexerExpression(MakeIndexer(ScopeGlobal, "System"), MakeLiteral("Configuration"))); + m_Imports.push_back(MakeIndexer(ScopeGlobal, "Types").release()); + m_Imports.push_back(MakeIndexer(ScopeGlobal, "Icinga").release()); } ExpressionResult VariableExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const diff --git a/lib/config/expression.hpp b/lib/config/expression.hpp index 6c36f06e7..21ab7a2e6 100644 --- a/lib/config/expression.hpp +++ b/lib/config/expression.hpp @@ -10,6 +10,7 @@ #include "base/function.hpp" #include "base/exception.hpp" #include "base/scriptframe.hpp" +#include "base/shared-object.hpp" #include "base/convert.hpp" #include @@ -178,9 +179,11 @@ private: /** * @ingroup config */ -class Expression +class Expression : public SharedObject { public: + DECLARE_PTR_TYPEDEFS(Expression); + Expression() = default; Expression(const Expression&) = delete; virtual ~Expression(); @@ -203,7 +206,7 @@ std::unique_ptr MakeIndexer(ScopeSpecifier scopeSpec, const String& class OwnedExpression final : public Expression { public: - OwnedExpression(std::shared_ptr expression) + OwnedExpression(Expression::Ptr expression) : m_Expression(std::move(expression)) { } @@ -219,7 +222,7 @@ protected: } private: - std::shared_ptr m_Expression; + Expression::Ptr m_Expression; }; class LiteralExpression final : public Expression @@ -288,7 +291,7 @@ protected: class VariableExpression final : public DebuggableExpression { public: - VariableExpression(String variable, std::vector > imports, const DebugInfo& debugInfo = DebugInfo()); + VariableExpression(String variable, std::vector imports, const DebugInfo& debugInfo = DebugInfo()); String GetVariable() const { @@ -301,7 +304,7 @@ protected: private: String m_Variable; - std::vector > m_Imports; + std::vector m_Imports; friend void BindToScope(std::unique_ptr& expr, ScopeSpecifier scopeSpec); }; @@ -795,7 +798,7 @@ class FunctionExpression final : public DebuggableExpression public: FunctionExpression(String name, std::vector args, std::map >&& closedVars, std::unique_ptr expression, const DebugInfo& debugInfo = DebugInfo()) - : DebuggableExpression(debugInfo), m_Name(std::move(name)), m_Args(std::move(args)), m_ClosedVars(std::move(closedVars)), m_Expression(std::move(expression)) + : DebuggableExpression(debugInfo), m_Name(std::move(name)), m_Args(std::move(args)), m_ClosedVars(std::move(closedVars)), m_Expression(expression.release()) { } protected: @@ -805,7 +808,7 @@ private: String m_Name; std::vector m_Args; std::map > m_ClosedVars; - std::shared_ptr m_Expression; + Expression::Ptr m_Expression; }; class ApplyExpression final : public DebuggableExpression @@ -816,9 +819,9 @@ public: std::unique_ptr fterm, std::map >&& closedVars, bool ignoreOnError, std::unique_ptr expression, const DebugInfo& debugInfo = DebugInfo()) : DebuggableExpression(debugInfo), m_Type(std::move(type)), m_Target(std::move(target)), - m_Name(std::move(name)), m_Filter(std::move(filter)), m_Package(std::move(package)), m_FKVar(std::move(fkvar)), m_FVVar(std::move(fvvar)), - m_FTerm(std::move(fterm)), m_IgnoreOnError(ignoreOnError), m_ClosedVars(std::move(closedVars)), - m_Expression(std::move(expression)) + m_Name(std::move(name)), m_Filter(filter.release()), m_Package(std::move(package)), m_FKVar(std::move(fkvar)), m_FVVar(std::move(fvvar)), + m_FTerm(fterm.release()), m_IgnoreOnError(ignoreOnError), m_ClosedVars(std::move(closedVars)), + m_Expression(expression.release()) { } protected: @@ -828,28 +831,28 @@ private: String m_Type; String m_Target; std::unique_ptr m_Name; - std::shared_ptr m_Filter; + Expression::Ptr m_Filter; String m_Package; String m_FKVar; String m_FVVar; - std::shared_ptr m_FTerm; + Expression::Ptr m_FTerm; bool m_IgnoreOnError; std::map > m_ClosedVars; - std::shared_ptr m_Expression; + Expression::Ptr m_Expression; }; class NamespaceExpression final : public DebuggableExpression { public: NamespaceExpression(std::unique_ptr expression, const DebugInfo& debugInfo = DebugInfo()) - : DebuggableExpression(debugInfo), m_Expression(std::move(expression)) + : DebuggableExpression(debugInfo), m_Expression(expression.release()) { } protected: ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; private: - std::shared_ptr m_Expression; + Expression::Ptr m_Expression; }; class ObjectExpression final : public DebuggableExpression @@ -859,8 +862,8 @@ public: String zone, String package, std::map >&& closedVars, bool defaultTmpl, bool ignoreOnError, std::unique_ptr expression, const DebugInfo& debugInfo = DebugInfo()) : DebuggableExpression(debugInfo), m_Abstract(abstract), m_Type(std::move(type)), - m_Name(std::move(name)), m_Filter(std::move(filter)), m_Zone(std::move(zone)), m_Package(std::move(package)), m_DefaultTmpl(defaultTmpl), - m_IgnoreOnError(ignoreOnError), m_ClosedVars(std::move(closedVars)), m_Expression(std::move(expression)) + m_Name(std::move(name)), m_Filter(filter.release()), m_Zone(std::move(zone)), m_Package(std::move(package)), m_DefaultTmpl(defaultTmpl), + m_IgnoreOnError(ignoreOnError), m_ClosedVars(std::move(closedVars)), m_Expression(expression.release()) { } protected: @@ -870,13 +873,13 @@ private: bool m_Abstract; std::unique_ptr m_Type; std::unique_ptr m_Name; - std::shared_ptr m_Filter; + Expression::Ptr m_Filter; String m_Zone; String m_Package; bool m_DefaultTmpl; bool m_IgnoreOnError; std::map > m_ClosedVars; - std::shared_ptr m_Expression; + Expression::Ptr m_Expression; }; class ForExpression final : public DebuggableExpression diff --git a/lib/config/vmops.hpp b/lib/config/vmops.hpp index 8bd456d40..ea3098359 100644 --- a/lib/config/vmops.hpp +++ b/lib/config/vmops.hpp @@ -26,7 +26,7 @@ namespace icinga class VMOps { public: - static inline bool FindVarImportRef(ScriptFrame& frame, const std::vector >& imports, const String& name, Value *result, const DebugInfo& debugInfo = DebugInfo()) + static inline bool FindVarImportRef(ScriptFrame& frame, const std::vector& imports, const String& name, Value *result, const DebugInfo& debugInfo = DebugInfo()) { for (const auto& import : imports) { ExpressionResult res = import->Evaluate(frame); @@ -40,7 +40,7 @@ public: return false; } - static inline bool FindVarImport(ScriptFrame& frame, const std::vector >& imports, const String& name, Value *result, const DebugInfo& debugInfo = DebugInfo()) + static inline bool FindVarImport(ScriptFrame& frame, const std::vector& imports, const String& name, Value *result, const DebugInfo& debugInfo = DebugInfo()) { Value parent; @@ -91,7 +91,7 @@ public: } static inline Value NewFunction(ScriptFrame& frame, const String& name, const std::vector& argNames, - const std::map >& closedVars, const std::shared_ptr& expression) + const std::map >& closedVars, const Expression::Ptr& expression) { auto evaluatedClosedVars = EvaluateClosedVars(frame, closedVars); @@ -115,9 +115,9 @@ public: return new Function(name, wrapper, argNames); } - static inline Value NewApply(ScriptFrame& frame, const String& type, const String& target, const String& name, const std::shared_ptr& filter, - const String& package, const String& fkvar, const String& fvvar, const std::shared_ptr& fterm, const std::map >& closedVars, - bool ignoreOnError, const std::shared_ptr& expression, const DebugInfo& debugInfo = DebugInfo()) + static inline Value NewApply(ScriptFrame& frame, const String& type, const String& target, const String& name, const Expression::Ptr& filter, + const String& package, const String& fkvar, const String& fvvar, const Expression::Ptr& fterm, const std::map >& closedVars, + bool ignoreOnError, const Expression::Ptr& expression, const DebugInfo& debugInfo = DebugInfo()) { ApplyRule::AddRule(type, target, name, expression, filter, package, fkvar, fvvar, fterm, ignoreOnError, debugInfo, EvaluateClosedVars(frame, closedVars)); @@ -125,8 +125,8 @@ public: return Empty; } - static inline Value NewObject(ScriptFrame& frame, bool abstract, const Type::Ptr& type, const String& name, const std::shared_ptr& filter, - const String& zone, const String& package, bool defaultTmpl, bool ignoreOnError, const std::map >& closedVars, const std::shared_ptr& expression, const DebugInfo& debugInfo = DebugInfo()) + static inline Value NewObject(ScriptFrame& frame, bool abstract, const Type::Ptr& type, const String& name, const Expression::Ptr& filter, + const String& zone, const String& package, bool defaultTmpl, bool ignoreOnError, const std::map >& closedVars, const Expression::Ptr& expression, const DebugInfo& debugInfo = DebugInfo()) { ConfigItemBuilder item{debugInfo}; diff --git a/lib/remote/eventqueue.cpp b/lib/remote/eventqueue.cpp index 5b6219c10..1125a4543 100644 --- a/lib/remote/eventqueue.cpp +++ b/lib/remote/eventqueue.cpp @@ -126,7 +126,7 @@ EventQueueRegistry *EventQueueRegistry::GetInstance() } std::mutex EventsInbox::m_FiltersMutex; -std::map EventsInbox::m_Filters ({{"", EventsInbox::Filter{1, nullptr}}}); +std::map EventsInbox::m_Filters ({{"", EventsInbox::Filter{1, Expression::Ptr()}}}); EventsRouter EventsRouter::m_Instance; @@ -146,7 +146,7 @@ EventsInbox::EventsInbox(String filter, const String& filterSource) m_Filter = m_Filters.find(filter); if (m_Filter == m_Filters.end()) { - m_Filter = m_Filters.emplace(std::move(filter), Filter{1, std::shared_ptr(expr.release())}).first; + m_Filter = m_Filters.emplace(std::move(filter), Filter{1, Expression::Ptr(expr.release())}).first; } else { ++m_Filter->second.Refs; } @@ -164,7 +164,7 @@ EventsInbox::~EventsInbox() } } -const std::shared_ptr& EventsInbox::GetFilter() +const Expression::Ptr& EventsInbox::GetFilter() { return m_Filter->second.Expr; } @@ -230,7 +230,7 @@ const EventsInbox::Ptr& EventsSubscriber::GetInbox() return m_Inbox; } -EventsFilter::EventsFilter(std::map, std::set> inboxes) +EventsFilter::EventsFilter(std::map> inboxes) : m_Inboxes(std::move(inboxes)) { } diff --git a/lib/remote/eventqueue.hpp b/lib/remote/eventqueue.hpp index ec389929a..c8317cb74 100644 --- a/lib/remote/eventqueue.hpp +++ b/lib/remote/eventqueue.hpp @@ -94,7 +94,7 @@ public: EventsInbox& operator=(EventsInbox&&) = delete; ~EventsInbox(); - const std::shared_ptr& GetFilter(); + const Expression::Ptr& GetFilter(); void Push(Dictionary::Ptr event); Dictionary::Ptr Shift(boost::asio::yield_context yc, double timeout = 5); @@ -103,7 +103,7 @@ private: struct Filter { std::size_t Refs; - std::shared_ptr Expr; + Expression::Ptr Expr; }; static std::mutex m_FiltersMutex; @@ -135,14 +135,14 @@ private: class EventsFilter { public: - EventsFilter(std::map, std::set> inboxes); + EventsFilter(std::map> inboxes); operator bool(); void Push(Dictionary::Ptr event); private: - std::map, std::set> m_Inboxes; + std::map> m_Inboxes; }; class EventsRouter @@ -165,7 +165,7 @@ private: ~EventsRouter() = default; std::mutex m_Mutex; - std::map, std::set>> m_Subscribers; + std::map>> m_Subscribers; }; }