VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vrfApp.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2001 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: vrfApp.h,v $ $Revision: 1.24 $ $State: Exp $
7 *******************************************************************************/
8 #ifndef vrfApp_H_
9 #define vrfApp_H_
10 
11 #include <vlutil/vlString.h>
12 #include <vlutil/vlList.h>
13 #include <vlutil/vlUtil.h>
14 #include <vl/hostStructs.h>
15 #include <vlutil/vlFilename.h>
16 #include <vl/rprFomMapper.h>
17 #include <vlutil/vlTime.h>
18 #include <vl/exerciseConn.h>
19 
20 class DtCgf;
21 class DtCgfDispatcher;
22 class DtExerciseConn;
23 class DtFomMapper;
24 class DtBatchManager;
25 class DtVrfCreator;
26 class DtVrfSimOptions;
27 #ifdef WIN32
28 class DtFilePrinter;
29 class DtWindowsConsolePrinter;
30 #endif
32 
33 // class DtVrfApp:
34 //
35 // Instances of DtVrfApp are the main class for the VR-Forces simulation
36 // back-end application.
37 
38 class DtVrfApp
39 {
40 public:
41 
42  // constructor
43  DtVrfApp(int argc, char** argv);
44 
45  // destructor
46  virtual ~DtVrfApp();
47 
48  // Initialization. Must be called before any other member functions
49  // are called.
50  virtual bool init(DtVrfCreator* creator = 0);
51 
52  // Main execution loop. Calls our DtCgf's tick(). Calls DtSleep() for a
53  // given time interval (the main loop sleep interval). Polls the keyboard
54  // for input. If a 'q' key press is received, exits the application.
55  virtual void mainLoop();
56 
57  // Accessor for the DtCgf
58  virtual DtCgf* cgf();
59 
60  // Accessor for the DtExerciseConn
61  virtual DtExerciseConn* exerciseConn();
62 
63 #ifdef WIN32
64  virtual void setConsoleWindow(HWND consoleWindow);
65 #endif
66 
67 protected:
68 
69  // Process mtl file. Also reads off mtl file (optionally) added to
70  // command line by -d command
71  virtual bool processMtlFile(int argc, char** argv);
72 
73  // Creates our cgf (called from init())
74  virtual DtCgf* createCgf(const DtSimulationAddress& addr, DtU32 sessionId);
75 
76  // Creates our simOptions (called from init())
78 
79  // This routine will read in the simulation options from the vrfSim.mtl
80  // file by default of the supplied filename
81  virtual bool readSimOptions(const DtFilename& mtlFile);
82 
83  // This routine will process the options read from the mtl file and set
84  // them in the appropriate places in the cgf. This method is called
85  // after the cgf has been initialized
86  virtual void processCgfOptions();
87 
88  // This routine will process app level options (parameter database, port,
89  // etc). This is called before processCgfOptions and before
90  // processCommandLine such that the command line options will take
91  // precedence over the .mtl options
92  virtual void processAppOptions();
93 
94  // Calls down to myCgf to schedule to load up all plugins from command line and vrfSim.mtl
95  virtual void addPluginsToLoad();
96 
97 private:
98  // copy constructor - not implemented
99  DtVrfApp(const DtVrfApp& orig);
100 
101  // assignment operator - not implemented
102  DtVrfApp& operator=(const DtVrfApp& orig);
103 
104 protected:
105 
106  // Our DIS/RPR (site id, application id) simulation address that
107  // uniquely identifies our application in an exercise.
108  DtSimulationAddress mySimAddress;
109 
110  // VR-Link exercise connection. Provides means by which all network
111  // interactions (PDUs/HLA objects and interactions) are sent/recieved.
112  DtExerciseConn* myExerciseConn;
113 
114  // Command line arguments are cached in our constructor so we can process
115  // them later in init().
116  int myArgc;
117  char** myArgv;
118 
119  // Driver for our CGF object that responds to network messages
121 
122  // Driver for CGF Object that handles execution of scenario batches.
124 
125  // Options that are read in from the vrfSim.mtl file
127 
129 
130 #ifdef WIN32
131  HWND myConsoleWindow;
132 
133  // Writes diagnostics to vrfSim.log
134  DtFilePrinter* myFilePrinter;
135 #endif
136 
137  // Publishes all diagnostics to network in comment interactions.
139 
141 };
142 
143 #endif
144 
145 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)