summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-02-11 17:23:08 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-02-11 17:23:08 +0100
commit0b8a9b55667e767f93e93adc1aee9bc3c05f1888 (patch)
tree3ddbe0c5f4c283ebfa33abbe688e8f23ef190aa2 /include
parent3b83968416bcc5710c394892bb2ac1cc79f0298a (diff)
Convert the spanningtree events to use the new cross-module event system
Diffstat (limited to 'include')
-rw-r--r--include/modules/spanningtree.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/include/modules/spanningtree.h b/include/modules/spanningtree.h
index 99f4f9fc4..0f51c35db 100644
--- a/include/modules/spanningtree.h
+++ b/include/modules/spanningtree.h
@@ -19,22 +19,23 @@
#pragma once
-struct AddServerEvent : public Event
-{
- const std::string servername;
- AddServerEvent(Module* me, const std::string& name)
- : Event(me, "new_server"), servername(name)
- {
- Send();
- }
-};
+#include "event.h"
-struct DelServerEvent : public Event
+class SpanningTreeEventListener : public Events::ModuleEventListener
{
- const std::string servername;
- DelServerEvent(Module* me, const std::string& name)
- : Event(me, "lost_server"), servername(name)
+ public:
+ SpanningTreeEventListener(Module* mod)
+ : ModuleEventListener(mod, "event/spanningtree")
{
- Send();
}
+
+ /** Fired when a server finishes burst
+ * @param server Server that recently linked and finished burst
+ */
+ virtual void OnServerLink(const std::string& server) { }
+
+ /** Fired when a server splits
+ * @param server Server that split
+ */
+ virtual void OnServerSplit(const std::string& server) { }
};