summaryrefslogtreecommitdiff
path: root/include/modules/spanningtree.h
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-02-12 16:35:02 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-02-12 16:35:02 +0100
commitae6967b8b30ebc956e3158127ecba5d01dc09204 (patch)
treeb0940ea9cbd75acfdaa655b3a9975f67e3f8ae48 /include/modules/spanningtree.h
parenta7aa76f17ac22897e08558f0f78d891d3d4f7de6 (diff)
parent7918febc630d7d6f94fda1a918fe7b98c2d0e742 (diff)
Merge branch 'master+crossmodevents'
Diffstat (limited to 'include/modules/spanningtree.h')
-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) { }
};