VR-Forces 4.1 Class Documentation
DtVrfGuiCommandLineParser.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: DtVrfGuiCommandLineParser.h,v $ $Revision: 121653 $ $State: Exp $
7 *******************************************************************************/
8 
11 
13 
14 #pragma once
15 
18 
20 
21 #include <cmdLine/cmdArg.h>
22 #include <cmdLine/cmdLine.h>
23 
24 #include <boost/function.hpp>
25 
26 namespace makVrf
27 {
30  {
31  protected:
32  typedef boost::function<void (std::vector<DtCmdLine::Arg*>&,
34 
35  public:
37 
39 
41  virtual void processCommandLine(makVrv::DtVrvApplicationConfiguration& appConfig, int argc, char** argv);
42 
44  virtual void removeAutoStartDriver();
45 
46  void setAllowObserverModeFlags(bool);
47 
48  protected:
49  struct BaseArgs
50  {
51  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver) = 0;
52  virtual std::string driverName() const = 0;
53  virtual std::string driverClass() const = 0;
54 
56  DtCmdLine::ValueArg<int>* siteId;
57  DtCmdLine::ValueArg<int>* appId;
58  };
59 
60  struct DisArgs : public BaseArgs
61  {
62  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args, std::string& autoStartDriver);
63  virtual std::string driverName() const;
64  virtual std::string driverClass() const;
65 
66  DtCmdLine::ValueArg<int>* port;
67  DtCmdLine::ValueArg<int>* exerciseId;
68  DtCmdLine::ValueArg<int>* disVersion;
69  DtCmdLine::ValueArg<std::string>* destinationAddress;
70  DtCmdLine::ValueArg<std::string>* deviceAddress;
71  DtCmdLine::ValueArg<std::string>* subnetMask;
72  DtCmdLine::ValueArg<std::string>* hostAddress;
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  };
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>* observerModeArg;
128  DtCmdLine::MultiArg<std::string>* pluginsToLoadArg;
129  DtCmdLine::ValueArg<std::string>* loadScenario;
130  DtCmdLine::SwitchArg* doNotLoadDefaultPluginsArg;
131  DtCmdLine::SwitchArg* doNotCheckPluginVersions;
132 
134  DtCmdLine::SwitchArg* pvdModeOnly;
135  DtCmdLine::SwitchArg* stealthModeOnly;
136 
137  std::vector<BaseArgs*> additionalArguments;
138  };
139 
141  virtual void processArgs(makVrv::DtVrvApplicationConfiguration& appConfig, StealthArgs& args);
142  virtual std::vector<DtCmdLine::Arg*> createDefaultArguments(VrfGuiArgs& args);
143 
144  virtual void addArgumentParserAddition(const std::string&, DtAdditionalCommandsFcn fcn);
145 
148  BaseArgs*, std::string& autoStarted);
149 
150  virtual std::string createDriver(const makVrv::DtConfiguration& c, const std::string& driverName,
151  const std::string& driverClass, std::string& fullName);
152  virtual std::string createDriverFileName(const std::string& driverClass,const std::string& driverName);
153  virtual void addHlaCommandArguments(std::vector<DtCmdLine::Arg*>& a,
155 
157  virtual void bindObserverModes(const std::vector<std::string>&, makVrf::DtVrfGuiApplication::ObserverModeBindings&) const;
158 
159  protected:
160  virtual void addDisCommandArguments(std::vector<DtCmdLine::Arg*>&,
162  virtual void addHla13CommandArguments(std::vector<DtCmdLine::Arg*>&,
164  virtual void addHla1516CommandArguments(std::vector<DtCmdLine::Arg*>&,
166  virtual void addHla1516eCommandArguments(std::vector<DtCmdLine::Arg*>&,
168 
170 
172  virtual std::vector<std::string> defaultObserverMode() const;
173 
174  protected:
175  std::map<std::string, DtAdditionalCommandsFcn> myAdditionalCommands;
176  std::string myAutoStartDriver;
178  };
179 }
180 
181 #ifndef DtVrfGuiCommandLineParser_INL
182 #include <vrfGuiCore/DtVrfGuiCommandLineParser.inl>
183 #endif

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)