vrecko
virtual reality framework
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
vrecko
Vrecko - the Virtual Reality Engine
Dynamic Art module
L-system plant modeler - module for Vrecko
Head Up Display module
Space Partitioning - module for Vrecko
Todo List
Deprecated List
Namespaces
Classes
Files
File List
include
base
helpers
vrecko
Ability.h
Attribute.h
AttributesDescription.h
BaseClass.h
BenchmarkWriter.h
Device.h
DeviceManager.h
DynamicAttribute.h
Enumeration.h
EnvironmentObject.h
EventDispatcher.h
Interval.h
IOPins.h
Logger.h
Message.h
MTLock.h
OctTree.h
PersistentCache.h
PluginManager.h
PyAbility.h
Range.h
ReaderWriter.h
Scene.h
Scheduler.h
SP_CommonDefs.h
SP_ObjectInterface.h
SP_SceneInterface.h
StaticAttribute.h
Timer.h
Viewer.h
vThread.h
World.h
vreckoAP
vreckoDP
vreckoUtils
src
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Scheduler.h
Go to the documentation of this file.
1
/***************************************************************************
2
Scheduler.h - description
3
-------------------
4
begin : February 2004
5
copyright : (C) 2004 by Jan Flasar
6
email : flasar@fi.muni.cz
7
***************************************************************************/
8
9
#ifndef SCHEDULER_H
10
#define SCHEDULER_H
11
12
#include <vrecko/Export>
13
#include <
vrecko/BaseClass.h
>
14
#include <
vrecko/vThread.h
>
15
16
#include <map>
17
#include <vector>
18
19
20
namespace
vrecko {
21
22
#define FRAME_FREQUENCY -1.0
23
24
class
World
;
25
27
class
VRECKO_EXPORT
Scheduler
{
28
public
:
29
Scheduler
();
30
~
Scheduler
();
31
Scheduler
(
Scheduler
&s);
32
33
void
update(
void
);
34
35
void
start(
void
);
36
void
stop(
void
);
37
38
53
void
addEntity(
BaseClass
*ent,
float
frequency =
FRAME_FREQUENCY
);
54
71
void
addEntity(
BaseClass
*ent,
const
std::string &private_timer_name,
float
frequency =
FRAME_FREQUENCY
);
72
74
void
removeEntity(
BaseClass
*ent);
75
77
bool
isEntityPresent(
BaseClass
*ent);
78
80
bool
getState
() {
return
state;}
81
83
void
resetObjectUpdatesCounter
() { iObjectUpdatesCounter = 0; }
84
86
int
getObjectUpdatesCounter
() {
return
iObjectUpdatesCounter; }
87
88
protected
:
89
typedef
struct
{
90
float
frequency
;
91
vThread
*
thread_ptr
;
92
osg::Timer_t
last_tick
;
93
std::vector<BaseClass*>
entity_vector
;
94
}
TimerStruct
;
95
typedef
std::map<float, TimerStruct >
TimerMap
;
96
TimerMap
timer_map
;
97
typedef
std::map<std::string, TimerStruct >
PrivateTimerMap
;
98
PrivateTimerMap
private_timer_map
;
99
bool
state
;
100
101
int
iObjectUpdatesCounter
;
102
103
struct
classcomp
{
104
bool
operator() (
const
long
int
&lhs,
const
long
int
&rhs)
const
{
return
lhs > rhs;}
105
};
106
110
std::multimap<long int, BaseClass*, classcomp>
updateMMap
;
111
112
};
113
114
}
115
116
#endif
117
include
vrecko
Scheduler.h
Generated on Tue Feb 19 2013 10:23:41 for vrecko by
1.8.3.1