VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
timer.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
15 
16 #pragma once
17 
18 #include <vrfutil/simClock.h>
19 #include <vlutil/vlList.h>
20 
21 class DtScheduler;
22 class DtTimer;
23 
24 typedef void (*DtTimerCallbackFcn)(DtTimer *timer);
25 
37 #include "vrfcore/vrfcoreDefines.h"
39 {
40 
41 public:
42 
52  DtTimer(const unsigned int type, const DtTime fireTime,
53  const DtTimerCallbackFcn callback, void *usr);
54 
56  DtTimer(const DtTimer & orig);
57 
59  DtTimer & operator=(const DtTimer & orig);
60 
62  virtual ~DtTimer();
63 
65  virtual bool tick(const DtTime simTime);
66 
70  virtual void reset(const DtTime fireTime);
71 
75  virtual void cancel();
76 
80  virtual void fire();
81 
83  virtual bool fired() const;
84 
86  virtual DtTime fireTime() const;
87 
91  virtual unsigned int timerType() const;
92 
94  virtual void * usrData();
95 
98  virtual bool cancelled() const;
99 
102  virtual void setResortPending();
103  virtual void clearResortPending();
104  virtual bool resortPending() const;
105 
112  virtual void setDeleteAfterFire();
113  virtual void clearDeleteAfterFire();
114 
120  virtual bool deleteAfterFire() const;
121 
124  virtual bool managed() const;
125 
127  virtual void setScheduler(DtScheduler * scheduler);
128 
130  virtual bool periodIsRealTime() const;
131 
132 protected:
133 
136  const unsigned int myType;
139  void * myUsrData;
140  bool myFired;
145 };
146 
147 
Instances of class DtScheduler maintain a list of DtTimer objects. It ticks all timer objects each ti...
Definition: scheduler.h:22
DtScheduler * myScheduler
Definition: timer.h:134
Instances of DtTimer are used to maintain the information needed to represent some kind of scheduled ...
Definition: timer.h:38
const DtTimerCallbackFcn myCallback
Definition: timer.h:135
DtTime myFireTime
Definition: timer.h:143
bool myDeleteAfterFire
Definition: timer.h:141
File: vlClock.h.
bool myResortPending
Definition: timer.h:144
void * myUsrData
This pointer is the property of the DtTimer user and should not be modified in any way by DtTimer...
Definition: timer.h:139
const unsigned int myType
Definition: timer.h:136
bool myFired
Definition: timer.h:140
void(* DtTimerCallbackFcn)(DtTimer *timer)
Definition: timer.h:24
bool myCancelled
Definition: timer.h:142
#define DT_DLL_vrfcore
This file is used to determine how to build.
Definition: vrfcoreDefines.h:25

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)