diff options
| author | 2020-11-03 14:48:54 +0000 | |
|---|---|---|
| committer | 2020-11-03 19:54:13 +0000 | |
| commit | 89a21202de35eeec8ef464ada5e9fbb97fd83ba5 (patch) | |
| tree | b70c242c58bae562bef1d42c34c9d5d628d81208 /include | |
| parent | Clean up a bunch of contructors and destructors. (diff) | |
| download | inspircd++-89a21202de35eeec8ef464ada5e9fbb97fd83ba5.tar.gz inspircd++-89a21202de35eeec8ef464ada5e9fbb97fd83ba5.tar.bz2 inspircd++-89a21202de35eeec8ef464ada5e9fbb97fd83ba5.zip | |
Convert ConnectClass from reference<> to std::shared_ptr<>.
Diffstat (limited to 'include')
| -rw-r--r-- | include/configreader.h | 2 | ||||
| -rw-r--r-- | include/modules.h | 2 | ||||
| -rw-r--r-- | include/users.h | 10 |
3 files changed, 7 insertions, 7 deletions
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<reference<ConnectClass> > ClassVector; + typedef std::vector<std::shared_ptr<ConnectClass>> 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<ConnectClass> 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<ConfigTag> config; /** Type of line, either CC_ALLOW or CC_DENY @@ -160,10 +160,10 @@ struct CoreExport ConnectClass : public refcountbase ConnectClass(std::shared_ptr<ConfigTag> tag, char type, const std::string& mask); /** Create a new connect class with inherited settings. */ - ConnectClass(std::shared_ptr<ConfigTag> tag, char type, const std::string& mask, const ConnectClass& parent); + ConnectClass(std::shared_ptr<ConfigTag> tag, char type, const std::string& mask, std::shared_ptr<ConnectClass> parent); /** Update the settings in this block to match the given block */ - void Update(const ConnectClass* newSettings); + void Update(const std::shared_ptr<ConnectClass> 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<Local /** Contains a pointer to the connect class a user is on from */ - reference<ConnectClass> MyClass; + std::shared_ptr<ConnectClass> 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<ConnectClass> GetClass() const { return MyClass; } /** Call this method to find the matching \<connect> for a user, and to check them against it. */ |
