eRPC Generator (erpcgen)  Rev. 1.12.0
NXP Semiconductors
erpcgen::CGenerator Class Reference

Code generator for C. More...

#include <CGenerator.hpp>

Inheritance diagram for erpcgen::CGenerator:
erpcgen::Generator

Public Member Functions

 CGenerator (InterfaceDefinition *def)
 This function is constructor of CGenerator class. More...
 
virtual ~CGenerator ()
 This function is destructor of CGenerator class. More...
 
virtual void generate () override
 This function generate output code for output files. More...
 
- Public Member Functions inherited from erpcgen::Generator
 Generator (InterfaceDefinition *def, generator_type_t generatorType)
 Constructor. More...
 
virtual ~Generator ()
 Destructor.
 

Additional Inherited Members

- Public Types inherited from erpcgen::Generator
enum  generator_type_t {
  kC,
  kPython,
  kJava
}
 
typedef std::vector< DataType * > datatype_vector_t
 
- Protected Member Functions inherited from erpcgen::Generator
void openFile (std::ofstream &fileOutputStream, const std::string &fileName)
 This function open file. More...
 
void generateOutputFile (const std::string &fileName, const std::string &templateName, cpptempl::data_map &templateData, const char *const kParseFile)
 This function open file, generate output into this file and close this file. More...
 
std::string stripExtension (const std::string &filename)
 
StructMemberfindParamReferencedFromAnn (const StructType::member_vector_t &members, const std::string &referenceName, const std::string &annName)
 This function will return pointer to function parameter/structure member where given reference name is referenced for. More...
 
StructMemberfindParamReferencedFromUnion (const StructType::member_vector_t &members, const std::string &referenceName)
 This function will return pointer to function parameter/structure member where given reference name is referenced for. More...
 
StructMemberfindParamReferencedFrom (const StructType::member_vector_t &members, const std::string &referenceName)
 This function will return pointer to function parameter/structure member where given reference name is referenced for. Combines findParamReferencedFromUnion and findParamReferencedFromAnn. More...
 
std::string getTime ()
 This function return actual time string representation. More...
 
void findGroupDataTypes ()
 This function finds all group's data types.
 
cpptempl::data_list makeGroupInterfacesTemplateData (Group *group)
 This function sets interfaces template data. More...
 
std::string getGroupCommonFileName (Group *group)
 Function return common fileName part for group generated files. More...
 
void generateGroupOutputFiles (Group *group)
 This function generates output files for defined interfaces. More...
 
void makeIncludesTemplateData ()
 This function sets template data for include directives from an IDL file.
 
cpptempl::data_list makeGroupIncludesTemplateData (Group *group)
 This function sets template data for group include directives. More...
 
GroupgetGroupByName (const std::string &name)
 This function returns pointer to a group with specified name. More...
 
bool isMemberDataTypeUsingForwardDeclaration (Symbol *topSymbol, Symbol *memberSymbol)
 This function returns information if member data type symbol is using forward declared type. More...
 
std::string getOutputName (Symbol *symbol, bool check=true)
 
Annotation::program_lang_t getAnnotationLang ()
 Returns Generator flag used for annotation. More...
 
AnnotationfindAnnotation (Symbol *symbol, const std::string &name)
 Find annotation in the annotation list. More...
 
std::vector< Annotation * > getAnnotations (Symbol *symbol, const std::string &name)
 Find annotations matching name in the annotation list. More...
 
ValuegetAnnValue (Symbol *symbol, const std::string &name)
 This function search and returns Value object for given annotation name. More...
 
std::string getAnnStringValue (Symbol *symbol, const std::string &name)
 This function search and returns string for given annotation name. More...
 
datatype_vector_t getDataTypesFromSymbolScope (SymbolScope *scope, DataType::data_type_t datatype)
 This function returns vector of data types from scope. More...
 
- Protected Attributes inherited from erpcgen::Generator
uint16_t m_idlCrc16
 
cpptempl::data_map m_templateData
 
InterfaceDefinitionm_def
 
SymbolScopem_globals
 
std::vector< Group * > m_groups
 
std::set< std::string > reserverdWords
 
generator_type_t m_generatorType
 
std::filesystem::path m_outputDirectory
 

Detailed Description

Code generator for C.

Constructor & Destructor Documentation

CGenerator::CGenerator ( InterfaceDefinition def)
explicit

This function is constructor of CGenerator class.

Interface definition contains all information about parsed files and builtin types.

Parameters
[in]defContains all Symbols parsed from IDL files.
virtual erpcgen::CGenerator::~CGenerator ( )
inlinevirtual

This function is destructor of CGenerator class.

This function close opened files.

Member Function Documentation

void CGenerator::generate ( )
overridevirtual

This function generate output code for output files.

This code call all necessary functions for prepare output code and parse it into output files.

Implements erpcgen::Generator.


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