diff options
author | Adam <Adam@anope.org> | 2016-12-01 09:25:53 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-12-01 09:25:53 -0500 |
commit | ca28f9cfcbff0fbdb2afe96f1427245f83db7c47 (patch) | |
tree | ac5de801a4db01a7cb689ec670537ad74c7c53e6 /modules/operserv/dns.cpp | |
parent | 2f512281029fbf4f7ef9832e05804831ad2d9ba2 (diff) |
Allow objects to opt out of gc, don't gc accounts with users logged in
Also store cached state with the field by using Serialize::Storage for
field storage
Diffstat (limited to 'modules/operserv/dns.cpp')
-rw-r--r-- | modules/operserv/dns.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/modules/operserv/dns.cpp b/modules/operserv/dns.cpp index e607b1712..1ccb54530 100644 --- a/modules/operserv/dns.cpp +++ b/modules/operserv/dns.cpp @@ -27,11 +27,10 @@ class DNSZoneImpl : public DNSZone { friend class DNSZoneType; - Anope::string name; + Serialize::Storage<Anope::string> name; public: - DNSZoneImpl(Serialize::TypeBase *type) : DNSZone(type) { } - DNSZoneImpl(Serialize::TypeBase *type, Serialize::ID id) : DNSZone(type, id) { } + using DNSZone::DNSZone; Anope::string GetName() override; void SetName(const Anope::string &) override; @@ -72,10 +71,10 @@ class DNSServerImpl : public DNSServer ServiceReference<DNS::Manager> manager; - DNSZone *zone = nullptr; - Anope::string name; - unsigned int limit = 0; - bool pooled = false; + Serialize::Storage<DNSZone *> zone; + Serialize::Storage<Anope::string> name; + Serialize::Storage<unsigned int> limit; + Serialize::Storage<bool> pooled; /* is actually in the pool */ bool active = false; @@ -84,8 +83,7 @@ class DNSServerImpl : public DNSServer std::set<Anope::string, ci::less> zones; time_t repool = 0; - DNSServerImpl(Serialize::TypeBase *type) : DNSServer(type) { } - DNSServerImpl(Serialize::TypeBase *type, Serialize::ID id) : DNSServer(type, id) { } + using DNSServer::DNSServer; DNSZone *GetZone() override; void SetZone(DNSZone *) override; @@ -188,12 +186,11 @@ class DNSZoneMembershipImpl : public DNSZoneMembership { friend class DNSZoneMembershipType; - DNSServer *server = nullptr; - DNSZone *zone = nullptr; + Serialize::Storage<DNSServer *> server; + Serialize::Storage<DNSZone *> zone; public: - DNSZoneMembershipImpl(Serialize::TypeBase *type) : DNSZoneMembership(type) { } - DNSZoneMembershipImpl(Serialize::TypeBase *type, Serialize::ID id) : DNSZoneMembership(type, id) { } + using DNSZoneMembership::DNSZoneMembership; DNSServer *GetServer() override; void SetServer(DNSServer *) override; @@ -247,8 +244,8 @@ class DNSIPImpl : public DNSIP { friend class DNSIPType; - DNSServer *server = nullptr; - Anope::string ip; + Serialize::Storage<DNSServer *> server; + Serialize::Storage<Anope::string> ip; public: DNSIPImpl(Serialize::TypeBase *type) : DNSIP(type) { } |