Public Member Functions | Public Attributes | Static Public Attributes | List of all members
cSDHOptions Class Reference

class for command line option parsing holding option parsing results More...

#include <sdhoptions.h>

Public Member Functions

 cSDHOptions (char const *option_selection=SDHUSAGE_DEFAULT)
 
void OpenCommunication (NS_SDH cSDH &hand)
 
int Parse (int argc, char **argv, char const *helptext, char const *progname, char const *version, char const *libname, char const *librelease)
 
 ~cSDHOptions ()
 destructor, clean up More...
 

Public Attributes

unsigned long can_baudrate
 
bool controllerinfo
 
int debug_level
 
std::ostream * debuglog
 
bool do_RLE
 
char dsa_rs_device [MAX_DEV_LENGTH]
 
int dsa_tcp_port
 
bool dsa_use_tcp
 
int dsaport
 
int framerate
 
bool fullframe
 
unsigned int id_read
 
unsigned int id_write
 
int matrixinfo [6]
 
int net
 
double period
 
bool persistent
 
bool reset_to_default
 
unsigned long rs232_baudrate
 
char sdh_canpeak_device [MAX_DEV_LENGTH]
 
char sdh_rs_device [MAX_DEV_LENGTH]
 
int sdhport
 
double sensitivity [6]
 
bool sensorinfo
 
bool showdsasettings
 
std::string tcp_adr
 
int tcp_port
 
unsigned int threshold [6]
 
double timeout
 
std::string usage
 
bool use_can_esd
 
bool use_can_peak
 
bool use_fahrenheit
 
bool use_radians
 
bool use_tcp
 

Static Public Attributes

static int const MAX_DEV_LENGTH = 32
 

Detailed Description

class for command line option parsing holding option parsing results

Definition at line 78 of file sdhoptions.h.

Constructor & Destructor Documentation

cSDHOptions::cSDHOptions ( char const *  option_selection = SDHUSAGE_DEFAULT)

constructor: init members to their default values

Parameters
option_selection- string that names the options to include in helptext for online help. With a text including one of the following keywords the corresponding helptext is added to the usage helptext
  • "general" see sdhusage_general
  • "sdhcom_serial" see sdhusage_sdhcom_serial
  • "sdhcom_common" see sdhusage_sdhcom_common
  • "sdhcom_esdcan" see sdhusage_sdhcom_esdcan
  • "sdhcom_peakcan" see sdhusage_sdhcom_peakcan
  • "sdhcom_cancommon" see sdhusage_sdhcom_cancommon
  • "sdhcom_tcp" see sdhusage_sdhcom_tcp
  • "sdhother" see sdhusage_sdhother
  • "dsacom" see sdhusage_dsacom
  • "dsaother" see sdhusage_dsaother

Definition at line 380 of file sdhoptions.cpp.

cSDHOptions::~cSDHOptions ( )

destructor, clean up

Definition at line 457 of file sdhoptions.cpp.

Member Function Documentation

void cSDHOptions::OpenCommunication ( NS_SDH cSDH hand)

convenience function to open the communication of the given hand object according to the parsed parameters.

Parameters
hand- reference to a cSDH object to open

Definition at line 865 of file sdhoptions.cpp.

int cSDHOptions::Parse ( int  argc,
char **  argv,
char const *  helptext,
char const *  progname,
char const *  version,
char const *  libname,
char const *  librelease 
)

parse the command line parameters argc, argv into members. helptext, progname, version, libname and librelease are used when printing online help. start parsing at option with index *p_option_index parse all options if parse_all is true, else only one option is parsed

Returns
the optind index of the first non option argument in argv

Definition at line 464 of file sdhoptions.cpp.

Member Data Documentation

unsigned long cSDHOptions::can_baudrate

Definition at line 99 of file sdhoptions.h.

bool cSDHOptions::controllerinfo

Definition at line 114 of file sdhoptions.h.

int cSDHOptions::debug_level

Definition at line 85 of file sdhoptions.h.

std::ostream* cSDHOptions::debuglog

Definition at line 86 of file sdhoptions.h.

bool cSDHOptions::do_RLE

Definition at line 109 of file sdhoptions.h.

char cSDHOptions::dsa_rs_device[MAX_DEV_LENGTH]

Definition at line 108 of file sdhoptions.h.

int cSDHOptions::dsa_tcp_port

Definition at line 128 of file sdhoptions.h.

bool cSDHOptions::dsa_use_tcp

Definition at line 127 of file sdhoptions.h.

int cSDHOptions::dsaport

Definition at line 107 of file sdhoptions.h.

int cSDHOptions::framerate

Definition at line 111 of file sdhoptions.h.

bool cSDHOptions::fullframe

Definition at line 112 of file sdhoptions.h.

unsigned int cSDHOptions::id_read

Definition at line 100 of file sdhoptions.h.

unsigned int cSDHOptions::id_write

Definition at line 101 of file sdhoptions.h.

int cSDHOptions::matrixinfo[6]

Definition at line 115 of file sdhoptions.h.

int const cSDHOptions::MAX_DEV_LENGTH = 32
static

Definition at line 81 of file sdhoptions.h.

int cSDHOptions::net

Definition at line 94 of file sdhoptions.h.

double cSDHOptions::period

Definition at line 105 of file sdhoptions.h.

bool cSDHOptions::persistent

Definition at line 120 of file sdhoptions.h.

bool cSDHOptions::reset_to_default

Definition at line 119 of file sdhoptions.h.

unsigned long cSDHOptions::rs232_baudrate

Definition at line 91 of file sdhoptions.h.

char cSDHOptions::sdh_canpeak_device[MAX_DEV_LENGTH]

Definition at line 97 of file sdhoptions.h.

char cSDHOptions::sdh_rs_device[MAX_DEV_LENGTH]

Definition at line 89 of file sdhoptions.h.

int cSDHOptions::sdhport

Definition at line 88 of file sdhoptions.h.

double cSDHOptions::sensitivity[6]

Definition at line 117 of file sdhoptions.h.

bool cSDHOptions::sensorinfo

Definition at line 113 of file sdhoptions.h.

bool cSDHOptions::showdsasettings

Definition at line 121 of file sdhoptions.h.

std::string cSDHOptions::tcp_adr

Definition at line 124 of file sdhoptions.h.

int cSDHOptions::tcp_port

Definition at line 125 of file sdhoptions.h.

unsigned int cSDHOptions::threshold[6]

Definition at line 118 of file sdhoptions.h.

double cSDHOptions::timeout

Definition at line 90 of file sdhoptions.h.

std::string cSDHOptions::usage

Definition at line 83 of file sdhoptions.h.

bool cSDHOptions::use_can_esd

Definition at line 93 of file sdhoptions.h.

bool cSDHOptions::use_can_peak

Definition at line 96 of file sdhoptions.h.

bool cSDHOptions::use_fahrenheit

Definition at line 104 of file sdhoptions.h.

bool cSDHOptions::use_radians

Definition at line 103 of file sdhoptions.h.

bool cSDHOptions::use_tcp

Definition at line 123 of file sdhoptions.h.


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


sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Sun Aug 18 2019 03:42:21