VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtVreCommandLineProcessor Class Reference

Detailed Description

This class processes command line arguments for the VREngage application and configures the application accordingly. It extends the VR-Forces command line processor with support for protocol-specific options (–dis, –hla13, –hla1516, or –hla1516e). Using these options generates and auto-starts a new driver using the supplied arguments.

#include <vreCommandLineProcessor.h>

Inheritance diagram for makVre::DtVreCommandLineProcessor:
[legend]

Classes

struct  BaseArgs
 
struct  DisArgs
 
struct  Hla13Args
 
struct  Hla1516Args
 
struct  Hla1516eArgs
 
struct  VreArgs
 

Public Member Functions

 DtVreCommandLineProcessor ()
 
virtual ~DtVreCommandLineProcessor () override
 
virtual void processCommandLine (makVrv::DtVrvApplicationConfiguration &appConfig, int argc, char **argv) override
 
virtual void removeAutoStartDriver ()
 
const std::string & autoStartDriver () const
 
std::string customSettingsFile () const
 
std::string customSettingsString () const
 
std::string stationName () const
 
std::string applicationMode () const
 

Protected Types

using DtAdditionalCommandsFcn
 

Protected Member Functions

virtual void processArgs (makVrv::DtVrvApplicationConfiguration &appConfig, VreArgs &args)
 
virtual void createDriver (const makVrv::DtVrvApplicationConfiguration &appConfig, const makVrv::DtConfiguration &config, BaseArgs *baseArgs, std::string &autoStarted)
 
virtual std::string createDriver (const makVrv::DtVrvApplicationConfiguration &app, const makVrv::DtConfiguration &config, const std::string &driverName, const std::string &driverClass, std::string &fullName)
 
virtual std::string createDriverFileName (const makVrv::DtVrvApplicationConfiguration &app, const std::string &driverClass, const std::string &driverName)
 
virtual void addHlaCommandArguments (std::vector< DtCmdLine::Arg * > &argumentOrder, VreArgs &args, Hla13Args *hlaArgs)
 
virtual void setupArguments (VreArgs &args, std::vector< DtCmdLine::Arg * > &argumentOrder)
 
Protocol-Specific Argument Handlers

Methods to add protocol-specific flags to the parser

These methods are called when the optional flags "--dis", "--hla13", etc. are found on the command line to add protocol-specific command line arguments.

virtual void addDisCommandArguments (std::vector< DtCmdLine::Arg * > &argumentOrder, VreArgs &args)
 
virtual void addHla13CommandArguments (std::vector< DtCmdLine::Arg * > &argumentOrder, VreArgs &args)
 
virtual void addHla1516CommandArguments (std::vector< DtCmdLine::Arg * > &argumentOrder, VreArgs &args)
 
virtual void addHla1516eCommandArguments (std::vector< DtCmdLine::Arg * > &argumentOrder, VreArgs &args)
 

Protected Attributes

std::map< std::string, DtAdditionalCommandsFcnmyAdditionalCommands
 
std::string myAutoStartDriver
 
std::vector< DtCmdLine::Arg * > myAdditionalCommandLineArguments
 
std::string myApplicationMode
 

Member Typedef Documentation

◆ DtAdditionalCommandsFcn

Initial value:
boost::function<void(std::vector<DtCmdLine::Arg*>&, makVrv::DtStealthCommandLineProcessor::StealthArgs&)>

Constructor & Destructor Documentation

◆ DtVreCommandLineProcessor()

makVre::DtVreCommandLineProcessor::DtVreCommandLineProcessor ( )

Default constructor.

Creates a command line processor for VREngage and initializes the command line options

◆ ~DtVreCommandLineProcessor()

virtual makVre::DtVreCommandLineProcessor::~DtVreCommandLineProcessor ( )
overridevirtual

Virtual destructor.

Cleans up any resources allocated by the command line processor

Member Function Documentation

◆ processCommandLine()

virtual void makVre::DtVreCommandLineProcessor::processCommandLine ( makVrv::DtVrvApplicationConfiguration & appConfig,
int argc,
char ** argv )
overridevirtual

Processes command line arguments and updates application configuration.

Parameters
appConfigApplication configuration to update based on command line args
argcNumber of command line arguments
argvArray of command line argument strings

This method parses the command line arguments and modifies the application configuration accordingly. It handles protocol-specific options and creates drivers as needed.

◆ removeAutoStartDriver()

virtual void makVre::DtVreCommandLineProcessor::removeAutoStartDriver ( )
virtual

Removes any automatically created driver.

This method deletes any driver that was created by the command line processor for automatic connection startup

◆ autoStartDriver()

const std::string & makVre::DtVreCommandLineProcessor::autoStartDriver ( ) const
inline

Gets the name of the automatically created driver.

Returns
Name of the auto-start driver, or empty string if none created

This method returns the name of the driver that was automatically created based on command line arguments

References myAutoStartDriver.

Referenced by makVre::DtVreCommandLineProcessor::BaseArgs::processArgs(), makVre::DtVreCommandLineProcessor::DisArgs::processArgs(), and makVre::DtVreCommandLineProcessor::Hla13Args::processArgs().

◆ customSettingsFile()

std::string makVre::DtVreCommandLineProcessor::customSettingsFile ( ) const

Gets the initialization settings file path.

Returns
Path to the initialization settings file

Returns the initialization settings file path specified on the command line

◆ customSettingsString()

std::string makVre::DtVreCommandLineProcessor::customSettingsString ( ) const

◆ stationName()

std::string makVre::DtVreCommandLineProcessor::stationName ( ) const

Gets the station name.

Returns
Station name specified on the command line

Returns the station name specified on the command line

◆ applicationMode()

std::string makVre::DtVreCommandLineProcessor::applicationMode ( ) const

Gets the application mode.

Returns
Application mode specified on the command line

Returns the application mode specified on the command line (e.g., air, ground, sensor)

◆ processArgs()

virtual void makVre::DtVreCommandLineProcessor::processArgs ( makVrv::DtVrvApplicationConfiguration & appConfig,
VreArgs & args )
protectedvirtual

Updates application configuration based on parsed arguments.

Parameters
appConfigApplication configuration to update
argsParsed command line arguments

This method updates the application configuration based on the command line arguments that have been parsed into the VreArgs structure

◆ createDriver() [1/2]

virtual void makVre::DtVreCommandLineProcessor::createDriver ( const makVrv::DtVrvApplicationConfiguration & appConfig,
const makVrv::DtConfiguration & config,
BaseArgs * baseArgs,
std::string & autoStarted )
protectedvirtual

Creates a new driver after removing existing VR-Forces drivers.

Parameters
appConfigApplication configuration
configDriver configuration
baseArgsBase arguments for driver creation
autoStartedOutput parameter to store the name of the created driver

This method removes all existing drivers created by VR-Forces from the drivers path and creates a new driver based on the provided configuration

◆ createDriver() [2/2]

virtual std::string makVre::DtVreCommandLineProcessor::createDriver ( const makVrv::DtVrvApplicationConfiguration & app,
const makVrv::DtConfiguration & config,
const std::string & driverName,
const std::string & driverClass,
std::string & fullName )
protectedvirtual

Creates a new driver file with specific name and class.

Parameters
appApplication configuration
configDriver configuration
driverNameName for the driver
driverClassClass of the driver
fullNameOutput parameter to store the full path of the created driver
Returns
Name of the created driver

This method creates a new driver file based on the provided configuration, with the specified name and class

◆ createDriverFileName()

virtual std::string makVre::DtVreCommandLineProcessor::createDriverFileName ( const makVrv::DtVrvApplicationConfiguration & app,
const std::string & driverClass,
const std::string & driverName )
protectedvirtual

Generates a filename for a new auto-start driver file.

Parameters
appApplication configuration
driverClassClass of the driver
driverNameName of the driver
Returns
Generated filename for the driver

This method generates an appropriate filename for a new auto-start driver file

◆ addDisCommandArguments()

virtual void makVre::DtVreCommandLineProcessor::addDisCommandArguments ( std::vector< DtCmdLine::Arg * > & argumentOrder,
VreArgs & args )
protectedvirtual

Adds DIS-specific command line arguments.

Parameters
argumentOrderVector of arguments to append to
argsVreArgs structure to update with new arguments

◆ addHla13CommandArguments()

virtual void makVre::DtVreCommandLineProcessor::addHla13CommandArguments ( std::vector< DtCmdLine::Arg * > & argumentOrder,
VreArgs & args )
protectedvirtual

Adds HLA 1.3 specific command line arguments.

Parameters
argumentOrderVector of arguments to append to
argsVreArgs structure to update with new arguments

◆ addHla1516CommandArguments()

virtual void makVre::DtVreCommandLineProcessor::addHla1516CommandArguments ( std::vector< DtCmdLine::Arg * > & argumentOrder,
VreArgs & args )
protectedvirtual

Adds HLA 1516 specific command line arguments.

Parameters
argumentOrderVector of arguments to append to
argsVreArgs structure to update with new arguments

◆ addHla1516eCommandArguments()

virtual void makVre::DtVreCommandLineProcessor::addHla1516eCommandArguments ( std::vector< DtCmdLine::Arg * > & argumentOrder,
VreArgs & args )
protectedvirtual

Adds HLA 1516e specific command line arguments.

Parameters
argumentOrderVector of arguments to append to
argsVreArgs structure to update with new arguments

◆ addHlaCommandArguments()

virtual void makVre::DtVreCommandLineProcessor::addHlaCommandArguments ( std::vector< DtCmdLine::Arg * > & argumentOrder,
VreArgs & args,
Hla13Args * hlaArgs )
protectedvirtual

Adds command line arguments common to all HLA versions.

Parameters
argumentOrderVector of arguments to append to
argsVreArgs structure to update with new arguments
hlaArgsHLA-specific arguments structure to update

This method adds command line arguments that are common to all HLA versions

◆ setupArguments()

virtual void makVre::DtVreCommandLineProcessor::setupArguments ( VreArgs & args,
std::vector< DtCmdLine::Arg * > & argumentOrder )
protectedvirtual

Sets up default argument values.

Parameters
argsVreArgs structure to set up defaults for
argumentOrderVector of arguments to append to

This method initializes default values for any command line arguments not explicitly specified by the user

Member Data Documentation

◆ myAdditionalCommands

std::map<std::string, DtAdditionalCommandsFcn> makVre::DtVreCommandLineProcessor::myAdditionalCommands
protected

Map of command names to handler functions for additional commands.

◆ myAutoStartDriver

std::string makVre::DtVreCommandLineProcessor::myAutoStartDriver
protected

Name of the automatically created driver.

Referenced by autoStartDriver().

◆ myAdditionalCommandLineArguments

std::vector<DtCmdLine::Arg*> makVre::DtVreCommandLineProcessor::myAdditionalCommandLineArguments
protected

List of additional command line arguments.

◆ myApplicationMode

std::string makVre::DtVreCommandLineProcessor::myApplicationMode
protected

Current application mode.


The documentation for this class was generated from the following file: