VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vrfGuiCommandLineParser.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 
17 
18 #include <cmdLine/cmdArg.h>
19 #include <cmdLine/cmdLine.h>
20 
21 #include <boost/function.hpp>
22 
23 namespace makVrf
24 {
27  {
28  protected:
29  typedef boost::function<void (std::vector<DtCmdLine::Arg*>&,
31 
32  public:
34 
36 
38  virtual void processCommandLine(makVrv::DtVrvApplicationConfiguration& appConfig, int argc, char** argv);
39 
41  virtual void removeAutoStartDriver();
42 
43  void setAllowObserverModeFlags(bool);
44 
45  protected:
46  struct BaseArgs
47  {
48  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver) = 0;
49  virtual std::string driverName() const = 0;
50  virtual std::string driverClass() const = 0;
51 
53  DtCmdLine::ValueArg<int>* siteId;
54  DtCmdLine::ValueArg<int>* appId;
55  DtCmdLine::SwitchArg* useAbsoluteTimeStamps;
56  DtCmdLine::ValueArg<int>* fileTransporterReceivePort;
57  };
58 
59  struct DisArgs : public BaseArgs
60  {
61  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver);
62  virtual std::string driverName() const;
63  virtual std::string driverClass() const;
64 
65  DtCmdLine::ValueArg<int>* port;
66  DtCmdLine::ValueArg<int>* exerciseId;
67  DtCmdLine::ValueArg<int>* disVersion;
68  DtCmdLine::ValueArg<std::string>* destinationAddress;
69  DtCmdLine::ValueArg<std::string>* deviceAddress;
70  DtCmdLine::ValueArg<std::string>* subnetMask;
71  DtCmdLine::ValueArg<std::string>* hostAddress;
72  DtCmdLine::ValueArg<int>* sessionId;
73  DtCmdLine::ValueArg<int>* receiveBufferSize;
74  DtCmdLine::ValueArg<int>* sendBufferSize;
75  DtCmdLine::SwitchArg* useAsynchIO;
76  DtCmdLine::SwitchArg* useIpv6;
77  DtCmdLine::ValueArg<int>* multicastTTL;
78  DtCmdLine::MultiArg<std::string>* multicastAddresses;
79  DtCmdLine::ValueArg<double>* defaultObjectTimeout;
80  };
81 
82  struct Hla13Args : public BaseArgs
83  {
84  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver);
85  virtual void setupHlaConfiguration(makVrv::DtConfiguration& config);
86  virtual std::string driverName() const;
87  virtual std::string driverClass() const;
88 
89  DtCmdLine::ValueArg<std::string>* execName;
90  DtCmdLine::ValueArg<std::string>* fedFileName;
91  DtCmdLine::ValueArg<std::string>* fomMapperLibName;
92  DtCmdLine::ValueArg<std::string>* fomMapperInitData;
93  DtCmdLine::ValueArg<std::string>* hostAddress;
94  DtCmdLine::ValueArg<int>* sessionId;
95  DtCmdLine::ValueArg<double>* rprFomVersion;
96  DtCmdLine::ValueArg<int>* rprFomRevision;
97  DtCmdLine::SwitchArg* useAdvisories;
98  DtCmdLine::SwitchArg* useGeographicDdm;
99  DtCmdLine::ValueArg<std::string>* federateType;
100  };
101 
102  struct Hla1516Args : public Hla13Args
103  {
104  virtual std::string driverName() const;
105  virtual std::string driverClass() const;
106  };
107 
108  struct Hla1516eArgs : public Hla13Args
109  {
110  virtual void setupHlaConfiguration(makVrv::DtConfiguration& config);
111 
112  virtual std::string driverName() const;
113  virtual std::string driverClass() const;
114 
115  DtCmdLine::MultiArg<std::string>* fomModule;
116  DtCmdLine::ValueArg<std::string>* federateName;
117  DtCmdLine::ValueArg<std::string>* localSettingsDesignator;
118  };
119 
121  {
122  DtCmdLine::SwitchArg* disMode;
123  DtCmdLine::SwitchArg* hla13Mode;
124  DtCmdLine::SwitchArg* hla1516Mode;
125  DtCmdLine::SwitchArg* hla1516eMode;
126 
127  DtCmdLine::MultiArg<std::string>* pluginsToLoadArg;
128  DtCmdLine::ValueArg<std::string>* loadScenario;
129  DtCmdLine::SwitchArg* doNotLoadDefaultPluginsArg;
130  DtCmdLine::SwitchArg* doNotCheckPluginVersions;
131  DtCmdLine::ValueArg<std::string>* gui;
132  DtCmdLine::ValueArg<std::string>* fowPerspective;
133 #ifdef USE_VLD_MEMORY_TRACKING
134  DtCmdLine::SwitchArg* useVld;
135 #endif
136 
138 
140  DtCmdLine::SwitchArg* pvdModeOnly;
141  DtCmdLine::SwitchArg* stealthModeOnly;
142 
143  std::vector<BaseArgs*> additionalArguments;
144  };
145 
147  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args);
148  virtual std::vector<DtCmdLine::Arg*> createDefaultArguments(VrfGuiArgs& args);
149 
150  virtual void addArgumentParserAddition(const std::string&, DtAdditionalCommandsFcn fcn);
151 
154  BaseArgs*, std::string& autoStarted);
155 
157  const std::string& driverName, const std::string& driverClass, std::string& fullName);
158  virtual std::string createDriverFileName(const makVrv::DtVrvApplicationConfiguration& a,
159  const std::string& driverClass,const std::string& driverName);
160  virtual void addHlaCommandArguments(std::vector<DtCmdLine::Arg*>& a,
162 
164  virtual void bindObserverModes(const std::vector<std::string>&, makVrf::DtVrfGuiApplication::ObserverModeBindings&) const;
165 
166  protected:
167  virtual void addDisCommandArguments(std::vector<DtCmdLine::Arg*>&,
169  virtual void addHla13CommandArguments(std::vector<DtCmdLine::Arg*>&,
171  virtual void addHla1516CommandArguments(std::vector<DtCmdLine::Arg*>&,
173  virtual void addHla1516eCommandArguments(std::vector<DtCmdLine::Arg*>&,
175 
177 
179  virtual std::vector<std::string> defaultObserverMode() const;
180 
181  protected:
182  std::map<std::string, DtAdditionalCommandsFcn> myAdditionalCommands;
183  std::string myAutoStartDriver;
185  };
186 }
187 
188 #ifndef DtVrfGuiCommandLineParser_INL
189 #include <vrfGuiCore/vrfGuiCommandLineParser.inl>
190 #endif

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)