Class CVSSHelper#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Derived Types#

Class Documentation#

class CVSSHelper#

VSS code generator helper class.

Subclassed by CCSVFileReader, CVSSBSCodingRX, CVSSBSCodingTX, CVSSBSGenerator, CVSSCodingCommon, CVSSVDCodingRX, CVSSVDCodingTX, CVSSVDGenerator

Public Static Functions

static bool VehicleDeviceVSSDefinitionExists(bool bSilent, const std::vector<SSignalVDDefinition> &vdSignals, const std::vector<SSignalBSDefinition> &bsSignals)#

Check if all required VD definitions are found required by the BS signals.

Parameters:
  • bSilent[in] if true do not print error to console.

  • vdSignals[in] containing all signals definitions of the vehicle devices.

  • bsSignals[in] containing all signals definitions of the basic services.

Returns:

Returns true on success when all definitions are found, otherwise false.

Protected Functions

void CreateCMakeFile(const std::filesystem::path &filePath, const std::string &cmakeContent) const#

Create the cmake if not exists and if content has changed.

Parameters:
  • filePath[in] full path to the file

  • cmakeContent[in] content of the cmake file

std::filesystem::path MakeLowercaseFilename(std::filesystem::path &fullPath) const#

Converts the filename of a full path to lowercase.

Parameters:

fullPath[in] full path

Returns:

Returns full path but the filename is lowercase

std::string Align(const std::string &ssInput, size_t size) const#

Add multiple space characters to increase the input string to a certain size.

Parameters:
  • ssInput[in] Reference to the input string.

  • size[in] of the final string.

Returns:

Returns the string increased by space characters.

std::string Trim(const std::string &ssInput) const#

trim spaces from begin of the string and end of the string

Parameters:

ssInput[in] Reference to the input string to be checked.

Returns:

Returns string without the spaces at front and at the end

bool MustNotContainSpaces(const std::string &ssInput) const#

check for space characters in the string.

Parameters:

ssInput[in] Reference to the input string to be checked.

Returns:

Returns true if string contains no space character, otherwise false.

size_t GetMaxClassName(const std::vector<SSignalVDDefinition> &signals, const std::string &ssTitle) const#

Get the maximal string size of all class names in the vector container.

Parameters:
  • signals[in] containing all signals definitions which have to be checked.

  • ssTitle[in] Reference to the title string. Is minimum of the return value.

Returns:

Returns the string size of the largest class name string.

size_t GetMaxIDLType(const std::vector<SSignalVDDefinition> &signals, const std::string &ssTitle) const#

Get the maximal string size of all IDL type strings in the vector container.

Parameters:
  • signals[in] containing all signals definitions which have to be checked.

  • ssTitle[in] Reference to the title string. Is minimum of the return value.

Returns:

Returns the string size of the largest IDL type string.

size_t GetMaxCTypeFromIDLType(const std::vector<SSignalVDDefinition> &signals, const std::string &ssTitle) const#

Get the maximal string size of all ctype strings in the vector container.

Parameters:
  • signals[in] containing all signals definitions which have to be checked.

  • ssTitle[in] Reference to the title string. Is minimum of the return value.

Returns:

Returns the string size of the largest ctype string.

size_t GetMaxSignalName(const std::vector<SSignalVDDefinition> &signals, const std::string &ssTitle) const#

Get the maximal string size of all signal name strings in the vector container.

Parameters:
  • signals[in] containing all signals definitions which have to be checked.

  • ssTitle[in] Reference to the title string. Is minimum of the return value.

Returns:

Returns the string size of the largest signal names string.

size_t GetMaxCANSignalName(const std::vector<SSignalVDDefinition> &signals, const std::string &ssTitle) const#

Get the maximal string size of all CAN signal name strings in the vector container.

Parameters:
  • signals[in] containing all signals definitions which have to be checked.

  • ssTitle[in] Reference to the title string. Is minimum of the return value.

Returns:

Returns the string size of the largest signal names string.

size_t GetMaxFunctionName(const std::vector<SSignalVDDefinition> &signals, const std::string &ssTitle) const#

Get the maximal string size of all function name strings in the vector container.

Parameters:
  • signals[in] containing all signals definitions which have to be checked.

  • ssTitle[in] Reference to the title string. Is minimum of the return value.

Returns:

Returns the string size of the largest function names string.

size_t GetMaxVSSDefinition(const std::vector<SSignalVDDefinition> &signals, const std::string &ssTitle) const#

Get the maximal string size of all vss strings in the vector container.

Parameters:
  • signals[in] containing all signals definitions which have to be checked.

  • ssTitle[in] Reference to the title string. Is minimum of the return value.

Returns:

Returns the string size of the largest vss string.

bool MustContainDotOrIsEmpty(const std::string &ssInput, bool mustBeEmpty) const#

check for ‘.’ characters in the string.

Parameters:
  • ssInput[in] Reference to the input string to be checked.

  • mustBeEmpty[in] If true input string must not be empty

Returns:

Returns true if string contains ‘.’ or is empty depending on mustBeEmpty, otherwise false.

std::string ValidateVSSFormatNumbers(const std::string &ssInput) const#

check if vss parts are string and no number. If number add ‘_’ for vehicle.chassis.axel.01.left return vehicle.chassis.axel._01.left

Parameters:

ssInput[in] Reference to the input string to be checked.

Returns:

Returns valid vss string.

bool IsNumber(const std::string &ssInput) const#

check if string is a number

Parameters:

ssInput[in] Reference to the input string to be checked.

Returns:

Returns false if it is a number, otherwise true.

std::string GenerateDefaultIfEmpty(const std::string &ssInput, std::string ssDefaultString, const uint32_t &index) const#

Returns input string or if empty, returns default string.

Parameters:
  • ssInput[in] string

  • ssDefaultString[in] string used as default if input string is empty

  • index[in] number will be added to the default string.

Returns:

Returns input string or if empty returns default string added by the number.

std::string AddQuotationMarks(const std::string &ssInput) const#

Returns input string but starts and ends with “’”.

Parameters:

ssInput[in] string

Returns:

Returns the input string with “’” added at the frond and the end.

std::string ReplaceCharacters(const std::string &ssInput, const std::string &from, const std::string &to) const#

Replaces some characters of the input string.

Parameters:
  • ssInput[in] string.

  • from[in] character to be replaced

  • to[in] replacement character.

Returns:

Returns the string with replacements.

std::string ToUpper(const std::string &ssInput) const#

turn the input string to upper case

Parameters:

ssInput[in] string.

Returns:

Returns the input string but all characters are upper case

std::string ShortenVSSString(const std::string &ssInput) const#

remove the last part of the vss string

Parameters:

ssInput[in] vss string

Returns:

Returns the string but removed the last part after charatcer ‘.’.

std::string GetCTypeFromIDLType(const std::string &ssIDLType) const#

find IDL type and return CType

Parameters:

ssIDLType[in] string representing IDL type

Returns:

CType string if IDL type found, otherwise empty string

bool ValidateIDLTypes(const std::vector<std::string> &vecTypes, const bool silent) const#

validate if all IDL type are valid

Parameters:
  • vecTypes[in] container of the IDL types

  • silent[in] information to console if not silent

Returns:

True if IDL types are valid, otherwise false

bool CreateFolder(const std::filesystem::path &rootPath, const std::string &subfolder) const#

Create folder or sub folder.

Parameters:
  • rootPath[in] complete root path

  • subfolder[in] in case this parameter is empty only root path is created otherwise rootPath + subfolder

Returns:

true if directory exists or is created successfully, otherwise false

void DeleteHeaderFile(const std::filesystem::path &path, const std::string &fileNameNoExtension) const#

deletes a header file

Parameters:
  • path[in] full path to a folder

  • fileNameNoExtension[in] a file name without the extension

void ValidateVDCodeStyle(const SFunctionVDDefinition &function, const bool verbose) const#

Validates the code style (signal name starts with lower case, function name upper case …

Parameters:
  • function[in] function definition structure

  • verbose[in] print information to console only if true

void ValidateBSCodeStyle(const SFunctionBSDefinition &function, const bool verbose) const#

Validates the code style (signal name starts with lower case, function name upper case …

Parameters:
  • function[in] function definition structure

  • verbose[in] print information to console only if true

void ValidateVDCodeStyle(const SSignalVDDefinition &signal, const bool verbose) const#

Validates the code style (signal name starts with lower case, function name upper case …

Parameters:
  • signal[in] signal definition structure

  • verbose[in] print information to console only if true

void ValidateBSCodeStyle(const SSignalBSDefinition &signal, const bool verbose) const#

Validates the code style (signal name starts with lower case, function name upper case …

Parameters:
  • signal[in] signal definition structure

  • verbose[in] print information to console only if true

struct SFunctionBSDefinition#

Signal definition structure (basic service) with a single function/value combination.

Public Members

std::string idlType#

signal value type (IDL: boolean, float, uint8, …)

std::string functionName#

signal value set function name

std::string signalName#

signal name

struct SFunctionVDDefinition#

Signal definition structure (vehicle device) with a single function/value combination.

Public Members

std::string idlType#

signal value type (IDL: boolean, float, uint8, …)

std::string functionName#

signal value set function name

std::string signalName#

signal name

std::string canSignalName#

can signal name (combination of signak messages and signal name)

struct SSignalBSDefinition#

Signal definition structure (basic service) with a single function/value combination.

Public Members

std::string vssDefinition#

vss interface string

std::string vssVDDefinition#

vss interface string

std::string className#

class name

sdv::core::ESignalDirection signalDirection = sdv::core::ESignalDirection::sigdir_rx#

signal direction, either rx or tx

std::vector<SFunctionBSDefinition> vecFunctions#

list of functions of the vss interface

struct SSignalVDDefinition#

Signal definition structure (vehicle device) with a single function/value combination.

Public Members

std::string vssDefinition#

vss interface string

std::string className#

class name

sdv::core::ESignalDirection signalDirection = sdv::core::ESignalDirection::sigdir_rx#

signal direction, either rx or tx

std::vector<SFunctionVDDefinition> vecFunctions#

list of functions of the vss interface