MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
14 #elif defined(DtIFSPEC1516E)
17 #else
18 #ifdef DtIFSPEC13DLC
21 #else
22 #include "simpleTimeAttribute13.h"
24 #endif
25 #endif
26 #include <queue>
27 
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,
38  Idle = 5};
39 
40  // constructor and destructor for 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
53 
54  // add an event to our event queue.
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 
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;
89  std::queue< attributeUpdateEvent* > myAttrUpdateQueue;
90  std::queue< interactionEvent* > myInteractionQueue;
91 };
92 
93 
94 #endif

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)