diff options
Diffstat (limited to 'include/modules/rpc.h')
-rw-r--r-- | include/modules/rpc.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/include/modules/rpc.h b/include/modules/rpc.h index 52d1d6492..719c459e8 100644 --- a/include/modules/rpc.h +++ b/include/modules/rpc.h @@ -21,9 +21,6 @@ namespace RPC class ServiceInterface; class Value; - /** Represents a list of registered events. */ - using Events = Anope::map<Event *>; - /** Represents possible types of RPC value. */ using ValueUnion = std::variant<Array, Map, Anope::string, std::nullptr_t, bool, double, int64_t, uint64_t>; @@ -171,15 +168,17 @@ public: inline const auto &GetRoot() const { return this->root; } }; +#define RPC_EVENT "RPC::Event" + class RPC::Event + : public Service { private: - Anope::string event; size_t minparams; protected: - Event(const Anope::string& e, size_t mp = 0) - : event(e) + Event(Module *o, const Anope::string& e, size_t mp = 0) + : Service(o, RPC_EVENT, e) , minparams(mp) { } @@ -187,8 +186,6 @@ protected: public: virtual ~Event() = default; - const auto &GetEvent() const { return event; } - const auto &GetMinParams() const { return minparams; } virtual bool Run(ServiceInterface *iface, HTTPClient *client, Request &request) = 0; @@ -203,12 +200,6 @@ public: { } - virtual const Events &GetEvents() = 0; - - virtual bool Register(Event *event) = 0; - - virtual bool Unregister(Event *event) = 0; - virtual void Reply(Request &request) = 0; }; |