diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-12 10:29:11 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-12 15:53:52 +0000 |
commit | cdcf0e2f9a8fb0e1c363fc65f71f3131fc6c5ea5 (patch) | |
tree | 3a665673235bb4dea58b99474492d90e0f711697 /include/regchannel.h | |
parent | 718f2e922a6e1113d66fc6e96131213942d507b2 (diff) |
Move serialization from Serializable to a Serialize::Type child.
Diffstat (limited to 'include/regchannel.h')
-rw-r--r-- | include/regchannel.h | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/include/regchannel.h b/include/regchannel.h index 9a7bf9880..22e3a0474 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -25,6 +25,14 @@ class CoreExport AutoKick final : public Serializable { public: + struct Type final + : public Serialize::Type + { + Type(); + void Serialize(const Serializable *obj, Serialize::Data &data) const override; + Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override; + }; + /* Channel this autokick is on */ Serialize::Reference<ChannelInfo> ci; @@ -38,8 +46,6 @@ public: AutoKick(); ~AutoKick(); - void Serialize(Serialize::Data &data) const override; - static Serializable *Unserialize(Serializable *obj, Serialize::Data &); }; /* It matters that Base is here before Extensible (it is inherited by Serializable) @@ -48,9 +54,18 @@ class CoreExport ChannelInfo final : public Serializable , public Extensible { +public: + struct Type final + : public Serialize::Type + { + Type(); + void Serialize(const Serializable *obj, Serialize::Data &data) const override; + Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override; + }; + +private: /* channels who reference this one */ Anope::map<int> references; -private: Serialize::Reference<NickCore> founder; /* Channel founder */ Serialize::Reference<NickCore> successor; /* Who gets the channel if the founder nick is dropped or expires */ Serialize::Checker<std::vector<ChanAccess *> > access; /* List of authorized users */ @@ -97,9 +112,6 @@ public: ~ChannelInfo(); ChannelInfo &operator=(const ChannelInfo &) = default; - void Serialize(Serialize::Data &data) const override; - static Serializable *Unserialize(Serializable *obj, Serialize::Data &); - /** Change the founder of the channel * @params nc The new founder */ |