Skyscraper
2.0
src
sbs
timer.h
Go to the documentation of this file.
1
/*
2
Scalable Building Simulator - Timer Object
3
The Skyscraper Project - Version 2.0
4
Copyright (C)2004-2024 Ryan Thoryk
5
https://www.skyscrapersim.net
6
https://sourceforge.net/projects/skyscraper/
7
Contact - ryan@skyscrapersim.net
8
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License
11
as published by the Free Software Foundation; either version 2
12
of the License, or (at your option) any later version.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU General Public License for more details.
18
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
*/
23
24
#ifndef _SBS_TIMER_H
25
#define _SBS_TIMER_H
26
27
namespace
SBS
{
28
29
class
SBSIMPEXP
TimerObject
:
public
Object
30
{
31
public
:
32
33
TimerObject
(
Object
*parent,
const
std::string &name);
34
virtual
~TimerObject
();
35
void
Start(
int
milliseconds = -1,
bool
oneshot =
false
);
36
void
Stop();
37
virtual
void
Notify
() {}
38
bool
IsRunning();
39
void
Loop();
40
unsigned
long
GetCurrentTime();
41
void
Report(
const
std::string &message);
42
43
private
:
44
int
Interval
;
45
bool
OneShot
;
46
unsigned
long
CurrentTime
;
47
unsigned
long
LastHit
;
48
unsigned
long
StartTime
;
49
bool
Running
;
50
};
51
52
}
53
54
#endif
SBS::Object
Definition
object.h:56
SBS::TimerObject
Definition
timer.h:30
SBS::TimerObject::Running
bool Running
Definition
timer.h:49
SBS::TimerObject::Notify
virtual void Notify()
Definition
timer.h:37
SBS::TimerObject::OneShot
bool OneShot
Definition
timer.h:45
SBS::TimerObject::Interval
int Interval
Definition
timer.h:44
SBS::TimerObject::CurrentTime
unsigned long CurrentTime
Definition
timer.h:46
SBS::TimerObject::LastHit
unsigned long LastHit
Definition
timer.h:47
SBS::TimerObject::StartTime
unsigned long StartTime
Definition
timer.h:48
SBSIMPEXP
#define SBSIMPEXP
Definition
globals.h:53
SBS
Definition
skyscraper.h:45
Generated by
1.11.0