VR-Forces 4.5 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
appsrc
vrfSim
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
31
class
DtBackendConsoleNetworkPrinter
;
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())
77
virtual
DtVrfSimOptions
*
createSimOptions
();
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
// Print out collected frame rate stats to file
98
virtual
void
logFrameRateStats
();
99
100
private
:
101
// copy constructor - not implemented
102
DtVrfApp
(
const
DtVrfApp
& orig);
103
104
// assignment operator - not implemented
105
DtVrfApp
&
operator=
(
const
DtVrfApp
& orig);
106
107
protected
:
108
109
// Our DIS/RPR (site id, application id) simulation address that
110
// uniquely identifies our application in an exercise.
111
DtSimulationAddress
mySimAddress
;
112
113
// VR-Link exercise connection. Provides means by which all network
114
// interactions (PDUs/HLA objects and interactions) are sent/recieved.
115
DtExerciseConn*
myExerciseConn
;
116
117
// Command line arguments are cached in our constructor so we can process
118
// them later in init().
119
int
myArgc
;
120
char
**
myArgv
;
121
122
// Driver for our CGF object that responds to network messages
123
DtCgfDispatcher
*
myDispatcher
;
124
125
// Driver for CGF Object that handles execution of scenario batches.
126
DtBatchManager
*
myBatchManager
;
127
128
// Options that are read in from the vrfSim.mtl file
129
DtVrfSimOptions
*
mySimOptions
;
130
131
DtCgf
*
myCgf
;
132
133
#ifdef WIN32
134
HWND myConsoleWindow;
135
136
// Writes diagnostics to vrfSim.log
137
DtFilePrinter* myFilePrinter;
138
#endif
139
140
// Publishes all diagnostics to network in comment interactions.
141
DtBackendConsoleNetworkPrinter
*
myBackendConsoleNetworkPrinter
;
142
143
bool
myWarnedFailedGetExitCode
;
144
};
145
146
#endif
147
148
Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (
www.mak.com
)