summaryrefslogtreecommitdiff
path: root/src/Instance.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-03-10 09:27:07 +0100
committerMax Kellermann <max@duempel.org>2016-03-10 20:32:43 +0100
commit5ffb82993ecf27ea1493771281d19f90fa73c46c (patch)
tree15dc9db438216f6c1f4b355b0127f783074845cb /src/Instance.hxx
parent07add0bd91b4f772f2895cd201edc615101a7fc3 (diff)
IdleMonitor: new class to replace GlobalEvents::IDLE
Use MaskMonitor to eliminate duplicate code.
Diffstat (limited to 'src/Instance.hxx')
-rw-r--r--src/Instance.hxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Instance.hxx b/src/Instance.hxx
index d3e928750..e4a2eed7d 100644
--- a/src/Instance.hxx
+++ b/src/Instance.hxx
@@ -22,6 +22,7 @@
#include "check.h"
#include "event/Loop.hxx"
+#include "IdleMaskMonitor.hxx"
#include "GlobalEvents.hxx"
#include "Compiler.h"
@@ -51,7 +52,8 @@ struct EventLoopHolder {
};
struct Instance final
- : EventLoopHolder
+ : EventLoopHolder,
+ IdleMaskMonitor
#if defined(ENABLE_DATABASE) || defined(ENABLE_NEIGHBOR_PLUGINS)
,
#endif
@@ -89,7 +91,9 @@ struct Instance final
StateFile *state_file;
- Instance():global_events(event_loop) {}
+ Instance()
+ :IdleMaskMonitor(event_loop),
+ global_events(event_loop) {}
/**
* Initiate shutdown. Wrapper for EventLoop::Break().
@@ -129,6 +133,9 @@ private:
virtual void FoundNeighbor(const NeighborInfo &info) override;
virtual void LostNeighbor(const NeighborInfo &info) override;
#endif
+
+ /* virtual methods from class IdleMaskMonitor */
+ void OnIdle(unsigned mask) override;
};
#endif