Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
application::helper::ArgumentConfiguration Class Reference

A helper class to manage the arguments passed to the main application. More...

#include <argument_configuration.h>

Public Member Functions

 ArgumentConfiguration (int argc, char *argv[], std::string defaultConfigFile="../../configuration/execution_manifest.arxml", std::string extendedVehicleConfigFile="../../configuration/extended_vehicle_manifest.arxml", std::string diagnosticManagerConfigFile="../../configuration/diagnostic_manager_manifest.arxml", std::string healthMonitoringConfigFile="../../configuration/health_monitoring_manifest.arxml")
 Constructor. More...
 
const std::map< std::string, std::string > & GetArguments () const noexcept
 Arguments property getter. More...
 
bool TryAskingVccApiKey (std::string message="Please enter the VCC API key:")
 Try asking the user to enter the VCC API key safely. More...
 
bool TryAskingBearToken (std::string message="Please enter the OAuth 2.0 bearer token:")
 Try asking the user to enter the OAuth 2.0 bearer token safely. More...
 

Static Public Attributes

static const std::string cConfigArgument {"config"}
 Execution manifest filename argument key.
 
static const std::string cEvConfigArgument {"evconfig"}
 Extended Vehicle AA manifest filename argument key.
 
static const std::string cDmConfigArgument {"dmconfig"}
 Diagnostic Manager manifest filename argument key.
 
static const std::string cPhmConfigArgument {"phmconfig"}
 Platform Health Management manifest filename argument key.
 
static const std::string cApiKeyArgument {"vccapikey"}
 VCC API key argument key.
 
static const std::string cBearerTokenArgument {"bearertoken"}
 OAuth 2.0 bearer token argument key.
 

Detailed Description

A helper class to manage the arguments passed to the main application.

Constructor & Destructor Documentation

◆ ArgumentConfiguration()

application::helper::ArgumentConfiguration::ArgumentConfiguration ( int  argc,
char *  argv[],
std::string  defaultConfigFile = "../../configuration/execution_manifest.arxml",
std::string  extendedVehicleConfigFile = "../../configuration/extended_vehicle_manifest.arxml",
std::string  diagnosticManagerConfigFile = "../../configuration/diagnostic_manager_manifest.arxml",
std::string  healthMonitoringConfigFile = "../../configuration/health_monitoring_manifest.arxml" 
)

Constructor.

Parameters
argcArgument count
argvPassed arguments
defaultConfigFileDefault execution manifest file path
extendedVehicleConfigFileDefault Extended Vehicle AA manifest file path
diagnosticManagerConfigFileDefault DM manifest file path
healthMonitoringConfigFileDefault PHM manifest file path

Member Function Documentation

◆ GetArguments()

const std::map< std::string, std::string > & application::helper::ArgumentConfiguration::GetArguments ( ) const
noexcept

Arguments property getter.

Returns
All the parsed and/or set arguments

◆ TryAskingBearToken()

bool application::helper::ArgumentConfiguration::TryAskingBearToken ( std::string  message = "Please enter the OAuth 2.0 bearer token:")

Try asking the user to enter the OAuth 2.0 bearer token safely.

Parameters
messageMessage to be shown on the console to ask the bearer token
Returns
True if the bearer token is set correctly; otherwise false

◆ TryAskingVccApiKey()

bool application::helper::ArgumentConfiguration::TryAskingVccApiKey ( std::string  message = "Please enter the VCC API key:")

Try asking the user to enter the VCC API key safely.

Parameters
messageMessage to be shown on the console to ask the API key
Returns
True if the API key is set correctly; otherwise false