diff options
Diffstat (limited to 'src/FbTk/Timer.hh')
-rw-r--r-- | src/FbTk/Timer.hh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/FbTk/Timer.hh b/src/FbTk/Timer.hh index bd55435..4b5be95 100644 --- a/src/FbTk/Timer.hh +++ b/src/FbTk/Timer.hh | |||
@@ -26,6 +26,7 @@ | |||
26 | #define FBTK_TIMER_HH | 26 | #define FBTK_TIMER_HH |
27 | 27 | ||
28 | #include "RefCount.hh" | 28 | #include "RefCount.hh" |
29 | #include "Command.hh" | ||
29 | 30 | ||
30 | #ifdef HAVE_CTIME | 31 | #ifdef HAVE_CTIME |
31 | #include <ctime> | 32 | #include <ctime> |
@@ -33,6 +34,7 @@ | |||
33 | #include <time.h> | 34 | #include <time.h> |
34 | #endif | 35 | #endif |
35 | #include <list> | 36 | #include <list> |
37 | #include <string> | ||
36 | 38 | ||
37 | #ifdef HAVE_CONFIG_H | 39 | #ifdef HAVE_CONFIG_H |
38 | #include "config.h" | 40 | #include "config.h" |
@@ -49,8 +51,6 @@ | |||
49 | 51 | ||
50 | namespace FbTk { | 52 | namespace FbTk { |
51 | 53 | ||
52 | class Command; | ||
53 | |||
54 | /** | 54 | /** |
55 | Handles Timeout | 55 | Handles Timeout |
56 | */ | 56 | */ |
@@ -107,7 +107,17 @@ private: | |||
107 | timeval m_timeout; ///< time length | 107 | timeval m_timeout; ///< time length |
108 | }; | 108 | }; |
109 | 109 | ||
110 | /// executes a command after a specified timeout | ||
111 | class DelayedCmd: public Command { | ||
112 | public: | ||
113 | DelayedCmd(RefCount<Command> &cmd, unsigned int timeout = 200000); | ||
114 | void execute(); | ||
115 | static Command *parse(const std::string &command, | ||
116 | const std::string &args, bool trusted); | ||
117 | private: | ||
118 | Timer m_timer; | ||
119 | }; | ||
120 | |||
110 | } // end namespace FbTk | 121 | } // end namespace FbTk |
111 | 122 | ||
112 | #endif // FBTK_TIMER_HH | 123 | #endif // FBTK_TIMER_HH |
113 | |||