VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
scheduler.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1999 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 #include <vlutil/vlList.h>
9 #include <vrfutil/simClock.h>
10 #include <tbb/spin_mutex.h>
11 
12 class DtTimer;
13 class DtSimManager;
14 
15 #include "vrfcore/vrfcoreDefines.h"
16 
22 class DT_DLL_vrfcore DtScheduler : public DtIntrusiveList
23 {
24 public:
25 
28  DtScheduler();
29  DtScheduler(DtSimManager * simManager);
30 
32  DtScheduler(const DtScheduler& orig);
33 
35  DtScheduler& operator=(const DtScheduler& orig);
36 
38  virtual ~DtScheduler() override;
39 
47  virtual void tick();
48 
51 
55  virtual void addTimer(DtTimer *timer);
56 
59  virtual void removeTimer (DtTimer *timer);
60 
63  virtual void reset(bool clearAll = false);
64 
67  void reSort(DtTimer *timer);
68 
69 protected:
70 
72  void doPendingResorts();
73 
76  void moveToEnd(DtTimer *timer);
77 
81  bool myInTick;
82 
84  tbb::spin_mutex myMutex;
85 };
Instances of class DtScheduler maintain a list of DtTimer objects. It ticks all timer objects each ti...
Definition: scheduler.h:22
Instances of DtTimer are used to maintain the information needed to represent some kind of scheduled ...
Definition: timer.h:38
tbb::spin_mutex myMutex
Definition: scheduler.h:84
bool myInTick
If in tick, ReSort() does NOT resort. Instead, it marks the timer as resortPending. These timers will be resorted at the end of the tick function.
Definition: scheduler.h:81
DtSimManager * mySimManager
Definition: scheduler.h:83
File: vlClock.h.
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:137
#define DT_DLL_vrfcore
This file is used to determine how to build.
Definition: vrfcoreDefines.h:25

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)