eRPC Generator (erpcgen)  Rev. 1.12.0
NXP Semiconductors
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 (const 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,
  kJavaLanguage
}
 
typedef vector< string > string_vector_t
 

Protected Attributes

int m_argc
 
char ** m_argv
 
StdoutLoggerm_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
 
string m_javaPackageName
 

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]argcCount of arguments in argv variable.
[in]argvPointer 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_errorThrown if an argument value fails to pass validation.
void erpcgen::erpcgenTool::printUsage ( const Options options)
inline

Prints help for the tool.

Parameters
[in]optionsOptions, 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
-1The 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
1The functions wasn't processed successfully.
0The function was processed successfully.
Exceptions
Log::errorThis function is called, when function wasn't processed successfully.
runtime_errorThrown, 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.

string erpcgen::erpcgenTool::m_javaPackageName
protected

Used java package.

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: