MAK RTIspy API Documentation for HLA 1.3
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
examples
simpletime
simpleTimeTimeManagedEntity.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2006 MaK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: simpleTimeTimeManagedEntity.h,v $ $Revision: 1.3 $ $State: Exp $
7
*******************************************************************************/
8
#ifndef _TIMEMANAGEDOBJECTDEFINITION_
9
#define _TIMEMANAGEDOBJECTDEFINITION_
10
// A simple object that dictates the behavior of an advancing entity.
11
#ifdef DtIFSPEC1516
12
#include "
simpleTimeAttribute1516.h
"
13
#include "
simpleTimeInteraction1516.h
"
14
#elif defined(DtIFSPEC1516E)
15
#include "
simpleTimeAttribute1516e.h
"
16
#include "
simpleTimeInteraction1516e.h
"
17
#else
18
#ifdef DtIFSPEC13DLC
19
#include "
simpleTimeAttribute13dlc.h
"
20
#include "
simpleTimeInteraction13dlc.h
"
21
#else
22
#include "
simpleTimeAttribute13.h
"
23
#include "
simpleTimeInteraction13.h
"
24
#endif
25
#endif
26
#include <queue>
27
28
class
timeManagedEntity
29
{
30
public
:
31
enum
entity_state
{
Alive
= 0,
32
FiredUpon
= 1,
33
Damaged
= 2,
34
Dead
= 3 };
35
enum
active_state
{
Initial
= 0,
36
Firing
= 1,
37
SendDetonate
= 3,
38
Idle
= 5};
39
40
// constructor and destructor for timeManagedEntity
41
timeManagedEntity
();
42
~timeManagedEntity
();
43
44
45
// Peek at our queue's of attributes and Interaction to see if there
46
// is an event waiting to be processed.
47
bool
attrUpdateWaiting
();
48
bool
interactionWaiting
();
49
50
// retreive an event from one of the event queue's
51
attributeUpdateEvent
*
getNextAttrUpdateEvent
();
52
interactionEvent
*
getNextInteractionEvent
();
53
54
// add an event to our event queue.
55
void
addAttrUpdateEvent
(
attributeUpdateEvent
*);
56
void
addInteractionEvent
(
interactionEvent
*);
57
58
// access this timeManagedEntity's state.
59
bool
shouldFire
();
60
bool
shouldDetonate
();
61
bool
isFiredUpon
();
62
bool
isDetonated
();
63
64
// Change this timeManagedEntity's state.
65
void
setPhaseLine
(
int
phaseLine);
66
void
incPosition
();
67
void
firePressed
();
68
void
reset
();
69
70
// Sets myState to the correct Value.
71
void
tick
();
72
73
private
:
74
void
sendFire
();
75
void
sendDetonate
();
76
void
processEvents
();
77
78
private
:
79
80
bool
myFirePressed
;
81
unsigned
int
myPosition
;
82
unsigned
int
myVelocity
;
83
84
// myPhaseLine acts as a boundary for this federate. When the position of the timeManagedEntity is past
85
// the myPhaseLine, the timeManagedEntity will start firing on other federates.
86
unsigned
int
myPhaseLine
;
87
entity_state
myPhysicalState
;
88
active_state
myState
;
89
std::queue< attributeUpdateEvent* >
myAttrUpdateQueue
;
90
std::queue< interactionEvent* >
myInteractionQueue
;
91
};
92
93
94
#endif
Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (
www.mak.com
)