VR-Forces 4.2 Class Documentation
DtVrfGuiCommandLineParser.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 
16 #include <vrvCore/DtStealthCommandLineProcessor.h>
17 
18 #include <cmdLine/cmdArg.h>
19 #include <cmdLine/cmdLine.h>
20 
21 #include <boost/function.hpp>
22 
23 namespace makVrf
24 {
26  class DtVrfGuiCommandLineParser : public makVrv::DtStealthCommandLineProcessor
27  {
28  protected:
29  typedef boost::function<void (std::vector<DtCmdLine::Arg*>&,
30  makVrv::DtStealthCommandLineProcessor::StealthArgs&)> DtAdditionalCommandsFcn;
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  };
57 
58  struct DisArgs : public BaseArgs
59  {
60  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver);
61  virtual std::string driverName() const;
62  virtual std::string driverClass() const;
63 
64  DtCmdLine::ValueArg<int>* port;
65  DtCmdLine::ValueArg<int>* exerciseId;
66  DtCmdLine::ValueArg<int>* disVersion;
67  DtCmdLine::ValueArg<std::string>* destinationAddress;
68  DtCmdLine::ValueArg<std::string>* deviceAddress;
69  DtCmdLine::ValueArg<std::string>* subnetMask;
70  DtCmdLine::ValueArg<std::string>* hostAddress;
71  DtCmdLine::ValueArg<int>* sessionId;
72  DtCmdLine::ValueArg<int>* receiveBufferSize;
73  DtCmdLine::ValueArg<int>* sendBufferSize;
74  DtCmdLine::SwitchArg* useAsynchIO;
75  DtCmdLine::SwitchArg* useIpv6;
76  DtCmdLine::ValueArg<int>* multicastTTL;
77  DtCmdLine::MultiArg<std::string>* multicastAddresses;
78  };
79 
80  struct Hla13Args : public BaseArgs
81  {
82  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver);
83  virtual void setupHlaConfiguration(makVrv::DtConfiguration& config);
84  virtual std::string driverName() const;
85  virtual std::string driverClass() const;
86 
87  DtCmdLine::ValueArg<std::string>* execName;
88  DtCmdLine::ValueArg<std::string>* fedFileName;
89  DtCmdLine::ValueArg<std::string>* fomMapperLibName;
90  DtCmdLine::ValueArg<std::string>* fomMapperInitData;
91  DtCmdLine::ValueArg<std::string>* hostAddress;
92  DtCmdLine::ValueArg<int>* sessionId;
93  DtCmdLine::ValueArg<double>* rprFomVersion;
94  DtCmdLine::ValueArg<int>* rprFomRevision;
95  DtCmdLine::SwitchArg* useAdvisories;
96  DtCmdLine::SwitchArg* useGeographicDdm;
97  DtCmdLine::ValueArg<std::string>* federateType;
98  };
99 
100  struct Hla1516Args : public Hla13Args
101  {
102  virtual std::string driverName() const;
103  virtual std::string driverClass() const;
104  };
105 
106  struct Hla1516eArgs : public Hla13Args
107  {
108  virtual void setupHlaConfiguration(makVrv::DtConfiguration& config);
109 
110  virtual std::string driverName() const;
111  virtual std::string driverClass() const;
112 
113  DtCmdLine::MultiArg<std::string>* fomModule;
114  DtCmdLine::ValueArg<std::string>* federateName;
115  DtCmdLine::ValueArg<std::string>* localSettingsDesignator;
116  };
117 
118  struct VrfGuiArgs : public makVrv::DtStealthCommandLineProcessor::StealthArgs
119  {
120  DtCmdLine::SwitchArg* disMode;
121  DtCmdLine::SwitchArg* hla13Mode;
122  DtCmdLine::SwitchArg* hla1516Mode;
123  DtCmdLine::SwitchArg* hla1516eMode;
124 
125  DtCmdLine::MultiArg<std::string>* pluginsToLoadArg;
126  DtCmdLine::ValueArg<std::string>* loadScenario;
127  DtCmdLine::SwitchArg* doNotLoadDefaultPluginsArg;
128  DtCmdLine::SwitchArg* doNotCheckPluginVersions;
129  DtCmdLine::ValueArg<std::string>* gui;
130 
132  DtCmdLine::SwitchArg* pvdModeOnly;
133  DtCmdLine::SwitchArg* stealthModeOnly;
134 
135  std::vector<BaseArgs*> additionalArguments;
136  };
137 
139  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args);
140  virtual std::vector<DtCmdLine::Arg*> createDefaultArguments(VrfGuiArgs& args);
141 
142  virtual void addArgumentParserAddition(const std::string&, DtAdditionalCommandsFcn fcn);
143 
145  virtual void createDriver(makVrv::DtVrvApplicationConfiguration&, const makVrv::DtConfiguration&,
146  BaseArgs*, std::string& autoStarted);
147 
148  virtual std::string createDriver(const makVrv::DtConfiguration& c, const std::string& driverName,
149  const std::string& driverClass, std::string& fullName);
150  virtual std::string createDriverFileName(const std::string& driverClass,const std::string& driverName);
151  virtual void addHlaCommandArguments(std::vector<DtCmdLine::Arg*>& a,
152  makVrv::DtStealthCommandLineProcessor::StealthArgs& args, Hla13Args* hlaArgs);
153 
155  virtual void bindObserverModes(const std::vector<std::string>&, makVrf::DtVrfGuiApplication::ObserverModeBindings&) const;
156 
157  protected:
158  virtual void addDisCommandArguments(std::vector<DtCmdLine::Arg*>&,
159  makVrv::DtStealthCommandLineProcessor::StealthArgs&);
160  virtual void addHla13CommandArguments(std::vector<DtCmdLine::Arg*>&,
161  makVrv::DtStealthCommandLineProcessor::StealthArgs&);
162  virtual void addHla1516CommandArguments(std::vector<DtCmdLine::Arg*>&,
163  makVrv::DtStealthCommandLineProcessor::StealthArgs&);
164  virtual void addHla1516eCommandArguments(std::vector<DtCmdLine::Arg*>&,
165  makVrv::DtStealthCommandLineProcessor::StealthArgs&);
166 
168 
170  virtual std::vector<std::string> defaultObserverMode() const;
171 
172  protected:
173  std::map<std::string, DtAdditionalCommandsFcn> myAdditionalCommands;
174  std::string myAutoStartDriver;
176  };
177 }
178 
179 #ifndef DtVrfGuiCommandLineParser_INL
180 #include <vrfGuiCore/DtVrfGuiCommandLineParser.inl>
181 #endif

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)