VR-Forces Development_Version 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<std::string>* appIdRange;
73  DtCmdLine::ValueArg<int>* sessionId;
74  DtCmdLine::ValueArg<int>* receiveBufferSize;
75  DtCmdLine::ValueArg<int>* sendBufferSize;
76  DtCmdLine::SwitchArg* useAsynchIO;
77  DtCmdLine::SwitchArg* useIpv6;
78  DtCmdLine::ValueArg<int>* multicastTTL;
79  DtCmdLine::MultiArg<std::string>* multicastAddresses;
80  DtCmdLine::ValueArg<double>* defaultObjectTimeout;
81  };
82 
83  struct Hla13Args : public BaseArgs
84  {
85  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver);
86  virtual void setupHlaConfiguration(makVrv::DtConfiguration& config, StealthArgs& args);
87  virtual std::string driverName() const;
88  virtual std::string driverClass() const;
89 
90  DtCmdLine::ValueArg<std::string>* execName;
91  DtCmdLine::ValueArg<std::string>* fedFileName;
92  DtCmdLine::ValueArg<std::string>* fomMapperLibName;
93  DtCmdLine::ValueArg<std::string>* fomMapperInitData;
94  DtCmdLine::ValueArg<std::string>* hostAddress;
95  DtCmdLine::ValueArg<int>* sessionId;
96  DtCmdLine::ValueArg<double>* rprFomVersion;
97  DtCmdLine::ValueArg<int>* rprFomRevision;
98  DtCmdLine::SwitchArg* useAdvisories;
99  DtCmdLine::SwitchArg* useGeographicDdm;
100  DtCmdLine::ValueArg<std::string>* federateType;
101  };
102 
103  struct Hla1516Args : public Hla13Args
104  {
105  virtual std::string driverName() const;
106  virtual std::string driverClass() const;
107  };
108 
109  struct Hla1516eArgs : public Hla13Args
110  {
111  virtual void setupHlaConfiguration(makVrv::DtConfiguration& config, StealthArgs& args);
112 
113  virtual std::string driverName() const;
114  virtual std::string driverClass() const;
115 
116  DtCmdLine::MultiArg<std::string>* fomModule;
117  DtCmdLine::ValueArg<std::string>* federateName;
118  DtCmdLine::ValueArg<std::string>* localSettingsDesignator;
119  };
120 
122  {
123  DtCmdLine::SwitchArg* disMode;
124  DtCmdLine::SwitchArg* hla13Mode;
125  DtCmdLine::SwitchArg* hla1516Mode;
126  DtCmdLine::SwitchArg* hla1516eMode;
127 
128  DtCmdLine::MultiArg<std::string>* pluginsToLoadArg;
129  DtCmdLine::ValueArg<std::string>* loadScenario;
130  DtCmdLine::SwitchArg* doNotLoadDefaultPluginsArg;
131  DtCmdLine::SwitchArg* doNotCheckPluginVersions;
132  DtCmdLine::ValueArg<std::string>* gui;
133  DtCmdLine::ValueArg<std::string>* fowPerspective;
134  DtCmdLine::ValueArg<std::string>* nonVrfObjectsUseUUIDScheme;
135  DtCmdLine::ValueArg<std::string>* useFileCommChannel;
136  DtCmdLine::ValueArg<std::string>* loadSimulationObjectGroup;
137  DtCmdLine::ValueArg<std::string>* defaultSimulationModelSet;
138  DtCmdLine::ValueArg<std::string>* layoutSettingsFile;
139 
140 #ifdef USE_VLD_MEMORY_TRACKING
141  DtCmdLine::SwitchArg* useVld;
142 #endif
143 
145 
147  DtCmdLine::SwitchArg* pvdModeOnly;
148  DtCmdLine::SwitchArg* stealthModeOnly;
149 
150  std::vector<BaseArgs*> additionalArguments;
151  };
152 
154  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args);
155  virtual std::vector<DtCmdLine::Arg*> createDefaultArguments(VrfGuiArgs& args);
156 
157  virtual void addArgumentParserAddition(const std::string&, DtAdditionalCommandsFcn fcn);
158 
161  BaseArgs*, std::string& autoStarted);
162 
164  const std::string& driverName, const std::string& driverClass, std::string& fullName);
165  virtual std::string createDriverFileName(const makVrv::DtVrvApplicationConfiguration& a,
166  const std::string& driverClass,const std::string& driverName);
167  virtual void addHlaCommandArguments(std::vector<DtCmdLine::Arg*>& a,
169 
171  virtual void bindObserverModes(const std::vector<std::string>&, makVrf::DtVrfGuiApplication::ObserverModeBindings&) const;
172 
173  protected:
174  virtual void addDisCommandArguments(std::vector<DtCmdLine::Arg*>&,
176  virtual void addHla13CommandArguments(std::vector<DtCmdLine::Arg*>&,
178  virtual void addHla1516CommandArguments(std::vector<DtCmdLine::Arg*>&,
180  virtual void addHla1516eCommandArguments(std::vector<DtCmdLine::Arg*>&,
182 
184 
186  virtual std::vector<std::string> defaultObserverMode() const;
187 
188  protected:
189  std::map<std::string, DtAdditionalCommandsFcn> myAdditionalCommands;
190  std::string myAutoStartDriver;
192  };
193 }
194 
195 #ifndef DtVrfGuiCommandLineParser_INL
196 #include <vrfGuiCore/vrfGuiCommandLineParser.inl>
197 #endif

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)