| eRPC Generator (erpcgen) Rev. 1.8.1 NXP Semiconductors

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Types | Protected Attributes | List of all members
erpcgen::erpcgenTool Class Reference

Class that encapsulates the erpcgen tool. More...

## Public Member Functions
| erpcgenTool (int argc, char *argv[])
| Constructor. More...
| ~erpcgenTool ()
| Destructor.
int | processOptions ()
| Reads the command line options passed into the constructor. More...
void | printUsage (Options &options)
| Prints help for the tool. More...
int | run ()
| Core of the tool. More...
void | checkArguments ()
| Validate arguments that can be checked. More...
void | setVerboseLogging ()
| Turns on verbose logging.

## Protected Types
enum | verbose_type_t { kWarning, kInfo, kDebug, kExtraDebug }
enum | languages_t { kCLanguage, kPythonLanguage }
typedef vector< string > | string_vector_t

## Protected Attributes
int | m_argc
char ** | m_argv
StdoutLogger * | m_logger
verbose_type_t | m_verboseType
const char * | m_outputFilePath
const char * | m_ErpcFile
string_vector_t | m_positionalArgs
languages_t | m_outputLanguage
InterfaceDefinition::codec_t | m_codec

## Detailed Description

Class that encapsulates the erpcgen tool.

A single global logger instance is created during object construction. It is never freed because we need it up to the last possible minute, when an exception could be thrown.

## Member Typedef Documentation

typedef vector<string> erpcgen::erpcgenTool::string_vector_t
| protected

Vector of positional arguments.

## Constructor & Destructor Documentation

erpcgen::erpcgenTool::erpcgenTool | ( | int | argc,
|  | char * | argv[]
| ) |  |
| inline

Constructor.

Parameters

  [in] | argc | Count of arguments in argv variable.
  [in] | argv | Pointer to array of arguments.

Creates the singleton logger instance.

## Member Function Documentation

void erpcgen::erpcgenTool::checkArguments | ( |  | ) |
| inline

Validate arguments that can be checked.

Exceptions

  runtime_error | Thrown if an argument value fails to pass validation.

void erpcgen::erpcgenTool::printUsage | ( | Options & | options | ) |
| inline

Prints help for the tool.

Parameters

  [in] | options | Options, which can be used.

int erpcgen::erpcgenTool::processOptions | ( |  | ) |
| inline

Reads the command line options passed into the constructor.

This method can return a return code to its caller, which will cause the tool to exit immediately with that return code value. Normally, though, it will return -1 to signal that the tool should continue to execute and all options were processed successfully.

The Options class is used to parse command line options. See #k_optionsDefinition for the list of options and #k_usageText for the descriptive help for each option.

Return values

  -1 | The options were processed successfully. Let the tool run normally.

Returns
  A zero or positive result is a return code value that should be returned from the tool as it exits immediately.

int erpcgen::erpcgenTool::run | ( |  | ) |
| inline

Core of the tool.

Calls processOptions() to handle command line options before performing the real work the tool does.

Return values

  1 | The functions wasn't processed successfully.
  0 | The function was processed successfully.

Exceptions

  Log::error | This function is called, when function wasn't processed successfully.
  runtime_error | Thrown, when positional args is empty.

## Member Data Documentation

int erpcgen::erpcgenTool::m_argc
| protected

Number of command line arguments.

char** erpcgen::erpcgenTool::m_argv
| protected

String value for each command line argument.

InterfaceDefinition::codec_t erpcgen::erpcgenTool::m_codec
| protected

Used codec type.

const char* erpcgen::erpcgenTool::m_ErpcFile
| protected

ERPC file.

StdoutLogger* erpcgen::erpcgenTool::m_logger
| protected

Singleton logger instance.

const char* erpcgen::erpcgenTool::m_outputFilePath
| protected

Path to the output file.

languages_t erpcgen::erpcgenTool::m_outputLanguage
| protected

Output language we're generating.

string_vector_t erpcgen::erpcgenTool::m_positionalArgs
| protected

Positional arguments.

verbose_type_t erpcgen::erpcgenTool::m_verboseType
| protected

Which type of log is need to set (warning, info, debug).

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

- erpcgen.cpp