Async 1.5.0
AsyncAtTimer.h
Go to the documentation of this file.
1
36#ifndef ASYNC_AT_TIMER_INCLUDED
37#define ASYNC_AT_TIMER_INCLUDED
38
39
40/****************************************************************************
41 *
42 * System Includes
43 *
44 ****************************************************************************/
45
46#include <time.h>
47#include <sigc++/sigc++.h>
48
49
50/****************************************************************************
51 *
52 * Project Includes
53 *
54 ****************************************************************************/
55
56#include <AsyncTimer.h>
57
58
59/****************************************************************************
60 *
61 * Local Includes
62 *
63 ****************************************************************************/
64
65
66
67/****************************************************************************
68 *
69 * Forward declarations
70 *
71 ****************************************************************************/
72
73
74
75/****************************************************************************
76 *
77 * Namespace
78 *
79 ****************************************************************************/
80
81namespace Async
82{
83
84
85/****************************************************************************
86 *
87 * Forward declarations of classes inside of the declared namespace
88 *
89 ****************************************************************************/
90
91
92
93/****************************************************************************
94 *
95 * Defines & typedefs
96 *
97 ****************************************************************************/
98
99
100
101/****************************************************************************
102 *
103 * Exported Global Variables
104 *
105 ****************************************************************************/
106
107
108
109/****************************************************************************
110 *
111 * Class definitions
112 *
113 ****************************************************************************/
114
135class AtTimer : public sigc::trackable
136{
137 public:
141 AtTimer(void);
142
149 AtTimer(struct tm &tm, bool do_start=true);
150
154 ~AtTimer(void);
155
161 bool setTimeout(time_t t);
162
168 bool setTimeout(struct tm &tm);
169
179 void setExpireOffset(int offset_ms);
180
185 bool start(void);
186
190 void stop(void);
191
200 sigc::signal<void, AtTimer *> expired;
201
202 protected:
203
204 private:
205 Timer m_timer;
206 struct timeval m_expire_at;
207 int m_expire_offset;
208
209 AtTimer(const AtTimer&);
210 AtTimer& operator=(const AtTimer&);
211 int msecToTimeout(void);
212 void onTimerExpired(Timer *t);
213
214}; /* class AtTimer */
215
216
217} /* namespace */
218
219#endif /* ASYNC_AT_TIMER_INCLUDED */
220
221
222
223/*
224 * This file has not been truncated
225 */
226
Contains a single shot or periodic timer that emits a signal on timeout.
A timer that times out at a specified absolute time.
Definition: AsyncAtTimer.h:136
AtTimer(struct tm &tm, bool do_start=true)
Constuctor.
~AtTimer(void)
Destructor.
sigc::signal< void, AtTimer * > expired
A signal that is emitted when the timer expires.
Definition: AsyncAtTimer.h:200
bool start(void)
Start the timer.
bool setTimeout(struct tm &tm)
Set the timeout time.
void setExpireOffset(int offset_ms)
Set the expire offset.
void stop(void)
Stop the timer.
bool setTimeout(time_t t)
Set the timeout time.
AtTimer(void)
Default constructor.
A class that produces timer events.
Definition: AsyncTimer.h:117
Namespace for the asynchronous programming classes.