From 89a21202de35eeec8ef464ada5e9fbb97fd83ba5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 3 Nov 2020 14:48:54 +0000 Subject: Convert ConnectClass from reference<> to std::shared_ptr<>. --- include/configreader.h | 2 +- include/modules.h | 2 +- include/users.h | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/configreader.h b/include/configreader.h index 80d189ca8..e1ade7ed9 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -279,7 +279,7 @@ class CoreExport ServerConfig /** Holds a complete list of all connect blocks */ - typedef std::vector > ClassVector; + typedef std::vector> ClassVector; /** Index of valid oper blocks and types */ diff --git a/include/modules.h b/include/modules.h index dc1059234..9fa273889 100644 --- a/include/modules.h +++ b/include/modules.h @@ -968,7 +968,7 @@ class CoreExport Module : public classbase, public usecountbase * @return MOD_RES_ALLOW to force the class to match, MOD_RES_DENY to forbid it, or * MOD_RES_PASSTHRU to allow normal matching (by host/port). */ - virtual ModResult OnSetConnectClass(LocalUser* user, ConnectClass* myclass); + virtual ModResult OnSetConnectClass(LocalUser* user, std::shared_ptr myclass); virtual ModResult OnNumeric(User* user, const Numeric::Numeric& numeric); diff --git a/include/users.h b/include/users.h index e58b18d16..9cb07f7e2 100644 --- a/include/users.h +++ b/include/users.h @@ -72,7 +72,7 @@ enum UserType { /** Holds information relevant to <connect allow> and <connect deny> tags in the config file. */ -struct CoreExport ConnectClass : public refcountbase +struct CoreExport ConnectClass { std::shared_ptr config; /** Type of line, either CC_ALLOW or CC_DENY @@ -160,10 +160,10 @@ struct CoreExport ConnectClass : public refcountbase ConnectClass(std::shared_ptr tag, char type, const std::string& mask); /** Create a new connect class with inherited settings. */ - ConnectClass(std::shared_ptr tag, char type, const std::string& mask, const ConnectClass& parent); + ConnectClass(std::shared_ptr tag, char type, const std::string& mask, std::shared_ptr parent); /** Update the settings in this block to match the given block */ - void Update(const ConnectClass* newSettings); + void Update(const std::shared_ptr newSettings); const std::string& GetName() { return name; } const std::string& GetHost() { return host; } @@ -707,12 +707,12 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node MyClass; + std::shared_ptr MyClass; /** Get the connect class which this user belongs to. * @return A pointer to this user's connect class. */ - ConnectClass* GetClass() const { return MyClass; } + std::shared_ptr GetClass() const { return MyClass; } /** Call this method to find the matching \ for a user, and to check them against it. */ -- cgit v1.3.1-10-gc9f91