libbbb
1.2.1
Groups common code used in some applications and libraries.
libbbb
Classes
Files
File List
src
antenna
autothread
backjob
bytebuffer
core
doevents
dynstack
jobinterf
lists
markup
memtrack
refcount
rexscript
templates
timer
timer.cc
timer.h
usermsg
varmap
File Members
•
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
timer.h
Go to the documentation of this file.
1
/* ========================================================================= */
2
/* ------------------------------------------------------------------------- */
/*
12
13
14
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
Please read COPYING and README files in root folder
16
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17
*/
18
/* ------------------------------------------------------------------------- */
19
/* ========================================================================= */
20
#ifndef __TIMER_INC__
21
#define __TIMER_INC__
22
//
23
//
24
//
25
//
26
/* INCLUDES ------------------------------------------------------------ */
27
28
#include <libbbb/libbbb.h>
29
#include <libbbb/amorph.h>
30
#include <QObject>
31
32
/* INCLUDES ============================================================ */
33
//
34
//
35
//
36
//
37
/* DEFINITIONS --------------------------------------------------------- */
38
39
namespace
bbb {
40
41
/* DEFINITIONS ========================================================= */
42
//
43
//
44
//
45
//
46
/* CLASS --------------------------------------------------------------- */
47
53
class
54
BBBSHARED_EXPORT
55
Timer
:
public
QObject {
56
57
58
//
59
//
60
//
61
//
62
/* DEFINITIONS ----------------------------------------------------- */
63
64
public
:
65
69
typedef
bool (*kbTimer) (
Timer
* t );
70
71
/* DEFINITIONS ===================================================== */
72
//
73
//
74
//
75
//
76
/* DATA ------------------------------------------------------------ */
77
78
private
:
79
83
int
id_;
84
88
kbTimer kb_;
89
90
/* DATA ============================================================ */
91
//
92
//
93
//
94
//
95
/* FUNCTIONS ------------------------------------------------------- */
96
97
public
:
98
99
103
Timer
(
void
);
104
105
109
virtual
~
Timer
(
void
);
110
111
115
kbTimer callback (
void
)
const
116
{
return
kb_; }
117
118
122
bool
isRunning (
void
)
const
123
{
return
id_ != 0; }
124
125
131
bool
start (
int
msec );
132
133
137
void
stop (
void
);
138
139
143
void
setCallback ( kbTimer kb )
144
{
145
kb_ = kb;
146
}
147
148
protected
:
149
153
void
timerEvent ( QTimerEvent * event );
154
155
/* FUNCTIONS ======================================================= */
156
//
157
//
158
//
159
//
160
161
};
/* class Timer */
162
163
/* CLASS =============================================================== */
164
//
165
//
166
//
167
//
168
/* CLASS --------------------------------------------------------------- */
169
170
class
171
BBBSHARED_EXPORT
172
Timer1
:
public
Timer
{
173
public
:
174
Amorph
a1_;
175
};
176
177
class
178
BBBSHARED_EXPORT
179
Timer2
:
public
Timer1
{
180
public
:
181
Amorph
a2_;
182
};
183
184
class
185
BBBSHARED_EXPORT
186
Timer3
:
public
Timer2
{
187
public
:
188
Amorph
a3_;
189
};
190
191
class
192
BBBSHARED_EXPORT
193
Timer4
:
public
Timer3
{
194
public
:
195
Amorph
a4_;
196
};
197
198
/* CLASS =============================================================== */
199
//
200
//
201
//
202
//
203
204
}
// namespace bbb
205
206
#endif // __TIMER_INC__
207
/* ------------------------------------------------------------------------- */
208
/* ========================================================================= */
src
timer
timer.h
Generated on Thu Aug 8 2013 20:10:33 for libbbb by
1.8.3.1