summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-10 12:14:27 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-10 12:14:27 +0200
commit8186e0b091a4f487448dcfab7144217a85870d4c (patch)
treec9fcaf950dfb3f208df1c44fd894f6852bda6b0d
parent792ba89c2ecd0db1e644405e16785f7092cd1c57 (diff)
Move the definition of Timer::Timer() into the source file from the header
Use initialization list
-rw-r--r--include/timer.h7
-rw-r--r--src/timer.cpp7
2 files changed, 8 insertions, 6 deletions
diff --git a/include/timer.h b/include/timer.h
index 503fa82a2..1787da7ba 100644
--- a/include/timer.h
+++ b/include/timer.h
@@ -53,12 +53,7 @@ class CoreExport Timer
* @param now The time now
* @param repeating Repeat this timer every secs_from_now seconds if set to true
*/
- Timer(unsigned int secs_from_now, time_t now, bool repeating = false)
- {
- trigger = now + secs_from_now;
- secs = secs_from_now;
- repeat = repeating;
- }
+ Timer(unsigned int secs_from_now, time_t now, bool repeating = false);
/** Default destructor, removes the timer from the timer manager
*/
diff --git a/src/timer.cpp b/src/timer.cpp
index 1c8de4cb9..4fee71742 100644
--- a/src/timer.cpp
+++ b/src/timer.cpp
@@ -30,6 +30,13 @@ void Timer::SetInterval(time_t newinterval)
ServerInstance->Timers.AddTimer(this);
}
+Timer::Timer(unsigned int secs_from_now, time_t now, bool repeating)
+ : trigger(now + secs_from_now)
+ , secs(secs_from_now)
+ , repeat(repeating)
+{
+}
+
Timer::~Timer()
{
ServerInstance->Timers.DelTimer(this);