aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Timer.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Timer.hh')
-rw-r--r--src/FbTk/Timer.hh10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/FbTk/Timer.hh b/src/FbTk/Timer.hh
index 241e327..bdaf3b8 100644
--- a/src/FbTk/Timer.hh
+++ b/src/FbTk/Timer.hh
@@ -85,15 +85,19 @@ private:
85 uint64_t m_timeout; ///< time length in microseconds 85 uint64_t m_timeout; ///< time length in microseconds
86}; 86};
87 87
88
89
88/// executes a command after a specified timeout 90/// executes a command after a specified timeout
89class DelayedCmd: public Command<void> { 91class DelayedCmd: public Command<void> {
90public: 92public:
91 DelayedCmd(const RefCount<Slot<void> > &cmd, unsigned int timeout = 200); 93
94 // timeout in microseconds
95 DelayedCmd(const RefCount<Slot<void> > &cmd, uint64_t timeout = 200);
92 96
93 // this constructor has inverted order of parameters to avoid ambiguity with the previous 97 // this constructor has inverted order of parameters to avoid ambiguity with the previous
94 // constructor 98 // constructor
95 template<typename Functor> 99 template<typename Functor>
96 DelayedCmd(unsigned int timeout, const Functor &functor) { 100 DelayedCmd(uint64_t timeout, const Functor &functor) {
97 initTimer(timeout); 101 initTimer(timeout);
98 m_timer.setFunctor(functor); 102 m_timer.setFunctor(functor);
99 } 103 }
@@ -102,7 +106,7 @@ public:
102 static Command<void> *parse(const std::string &command, 106 static Command<void> *parse(const std::string &command,
103 const std::string &args, bool trusted); 107 const std::string &args, bool trusted);
104private: 108private:
105 void initTimer(unsigned int timeout); 109 void initTimer(uint64_t timeout);
106 110
107 Timer m_timer; 111 Timer m_timer;
108}; 112};