VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 
14 #include <vrfGuiCore/vrfDe.h>
16 
18 
19 #include <cmdLine/cmdArg.h>
20 #include <cmdLine/cmdLine.h>
21 
22 #include <boost/function.hpp>
23 
24 namespace makVrf
25 {
28  {
29  protected:
30  typedef boost::function<void (std::vector<DtCmdLine::Arg*>&,
32 
33  public:
35 
37 
39  virtual void processCommandLine(makVrv::DtVrvApplicationConfiguration& appConfig, int argc, char** argv);
40 
42  virtual void removeAutoStartDriver();
43 
44  void setAllowObserverModeFlags(bool);
45 
48  virtual void addAdditionalCommandLineArgument(DtCmdLine::Arg* addlArg);
49 
50  const std::string& autoStartDriver() const
51  {
52  return myAutoStartDriver;
53  }
54 
55  protected:
56  struct BaseArgs
57  {
58  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver) = 0;
59  virtual std::string driverName() const = 0;
60  virtual std::string driverClass() const = 0;
61 
63  DtCmdLine::ValueArg<int>* siteId;
64  DtCmdLine::ValueArg<int>* appId;
65  DtCmdLine::SwitchArg* useAbsoluteTimeStamps;
66  DtCmdLine::ValueArg<int>* fileTransporterReceivePort;
67  };
68 
69  struct DisArgs : public BaseArgs
70  {
71  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver);
72  virtual std::string driverName() const;
73  virtual std::string driverClass() const;
74 
75  DtCmdLine::ValueArg<int>* port;
76  DtCmdLine::ValueArg<int>* exerciseId;
77  DtCmdLine::ValueArg<int>* disVersion;
78  DtCmdLine::ValueArg<std::string>* destinationAddress;
79  DtCmdLine::ValueArg<std::string>* deviceAddress;
80  DtCmdLine::ValueArg<std::string>* subnetMask;
81  DtCmdLine::ValueArg<std::string>* hostAddress;
82  DtCmdLine::ValueArg<std::string>* reportedHostAddress;
83  DtCmdLine::ValueArg<std::string>* appIdRange;
84  DtCmdLine::ValueArg<int>* sessionId;
85  DtCmdLine::ValueArg<int>* receiveBufferSize;
86  DtCmdLine::ValueArg<int>* sendBufferSize;
87  DtCmdLine::SwitchArg* useAsynchIO;
88  DtCmdLine::SwitchArg* useIpv6;
89  DtCmdLine::ValueArg<int>* multicastTTL;
90  DtCmdLine::MultiArg<std::string>* multicastAddresses;
91  DtCmdLine::ValueArg<double>* defaultObjectTimeout;
92  };
93 
94  struct Hla13Args : public BaseArgs
95  {
96  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver);
97  virtual void setupHlaConfiguration(makVrv::DtConfiguration& config, StealthArgs& args);
98  virtual std::string driverName() const;
99  virtual std::string driverClass() const;
100 
101  DtCmdLine::ValueArg<std::string>* execName;
102  DtCmdLine::ValueArg<std::string>* fedFileName;
103  DtCmdLine::ValueArg<std::string>* fomMapperLibName;
104  DtCmdLine::ValueArg<std::string>* fomMapperInitData;
105  DtCmdLine::ValueArg<std::string>* hostAddress;
106  DtCmdLine::ValueArg<std::string>* reportedHostAddress;
107  DtCmdLine::ValueArg<int>* sessionId;
108  DtCmdLine::ValueArg<double>* rprFomVersion;
109  DtCmdLine::ValueArg<int>* rprFomRevision;
110  DtCmdLine::SwitchArg* useAdvisories;
111  DtCmdLine::SwitchArg* useGeographicDdm;
112  DtCmdLine::ValueArg<std::string>* federateType;
113  };
114 
115  struct Hla1516Args : public Hla13Args
116  {
117  virtual std::string driverName() const;
118  virtual std::string driverClass() const;
119  };
120 
121  struct Hla1516eArgs : public Hla13Args
122  {
123  virtual void setupHlaConfiguration(makVrv::DtConfiguration& config, StealthArgs& args);
124 
125  virtual std::string driverName() const;
126  virtual std::string driverClass() const;
127 
128  DtCmdLine::MultiArg<std::string>* fomModule;
129  DtCmdLine::ValueArg<std::string>* federateName;
130  DtCmdLine::ValueArg<std::string>* localSettingsDesignator;
131  };
132 
134  {
135  DtCmdLine::SwitchArg* disMode;
136  DtCmdLine::SwitchArg* hla13Mode;
137  DtCmdLine::SwitchArg* hla1516Mode;
138  DtCmdLine::SwitchArg* hla1516eMode;
139 
140  DtCmdLine::MultiArg<std::string>* pluginsToLoadArg;
141  DtCmdLine::ValueArg<std::string>* loadScenario;
142  DtCmdLine::SwitchArg* doNotLoadDefaultPluginsArg;
143  DtCmdLine::SwitchArg* doNotCheckPluginVersions;
144  DtCmdLine::ValueArg<std::string>* gui;
145  DtCmdLine::ValueArg<std::string>* fowPerspective;
146  DtCmdLine::ValueArg<std::string>* nonVrfObjectsUseUUIDScheme;
147  DtCmdLine::ValueArg<std::string>* useFileCommChannel;
148  DtCmdLine::ValueArg<std::string>* loadSimulationObjectGroup;
149  DtCmdLine::ValueArg<std::string>* defaultSimulationModelSet;
150  DtCmdLine::ValueArg<std::string>* layoutSettingsFile;
151 
152 #ifdef USE_VLD_MEMORY_TRACKING
153  DtCmdLine::SwitchArg* useVld;
154 #endif
155 
157  DtCmdLine::SwitchArg* pvdModeOnly;
158  DtCmdLine::SwitchArg* stealthModeOnly;
159 
160  std::vector<BaseArgs*> additionalArguments;
161 
163  DtCmdLine::SwitchArg* enableLogFileTimestamps;
164  };
165 
167  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args);
168  virtual std::vector<DtCmdLine::Arg*> createDefaultArguments(VrfGuiArgs& args);
169 
170  virtual void addArgumentParserAddition(const std::string&, DtAdditionalCommandsFcn fcn);
171 
174  BaseArgs*, std::string& autoStarted);
175 
177  const std::string& driverName, const std::string& driverClass, std::string& fullName);
178  virtual std::string createDriverFileName(const makVrv::DtVrvApplicationConfiguration& a,
179  const std::string& driverClass,const std::string& driverName);
180  virtual void addHlaCommandArguments(std::vector<DtCmdLine::Arg*>& a,
182 
184  virtual void bindObserverModes(const std::vector<std::string>&, makVrf::DtVrfGuiApplication::ObserverModeBindings&) const;
185 
186  protected:
187  virtual void addDisCommandArguments(std::vector<DtCmdLine::Arg*>&,
189  virtual void addHla13CommandArguments(std::vector<DtCmdLine::Arg*>&,
191  virtual void addHla1516CommandArguments(std::vector<DtCmdLine::Arg*>&,
193  virtual void addHla1516eCommandArguments(std::vector<DtCmdLine::Arg*>&,
195 
197 
199  virtual std::vector<std::string> defaultObserverMode() const;
200 
201  protected:
202  std::map<std::string, DtAdditionalCommandsFcn> myAdditionalCommands;
203  std::string myAutoStartDriver;
205 
206  std::vector<DtCmdLine::Arg*> myAdditionalCommandLineArguments;
207  };
208 }
209 
210 #ifndef DtVrfGuiCommandLineParser_INL
211 #include <vrfGuiCore/vrfGuiCommandLineParser.inl>
212 #endif

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)