OMNeT++ NEDXML  6.0.3
MsgCodeGenerator Class Reference

#include <msgcodegenerator.h>

Description

Code generator part of the message compiler.

Public Types

typedef std::vector< std::string > StringVector
 
typedef MsgTypeTable::Properties Properties
 
typedef MsgTypeTable::FieldInfo FieldInfo
 
typedef MsgTypeTable::ClassInfo ClassInfo
 
typedef MsgTypeTable::EnumItem EnumItem
 
typedef MsgTypeTable::EnumInfo EnumInfo
 

Public Member Functions

 MsgCodeGenerator (ErrorStore *errors)
 
void openFiles (const char *hFile, const char *ccFile)
 
void closeFiles ()
 
void deleteFiles ()
 
void generateProlog (const std::string &msgFileName, const std::string &firstNamespace, const std::string &exportDef)
 
void generateEpilog ()
 
void generateClass (const ClassInfo &classInfo, const std::string &exportDef)
 
void generateStruct (const ClassInfo &classInfo, const std::string &exportDef)
 
void generateToAnyPtr (const ClassInfo &a)
 
void generateFromAnyPtr (const ClassInfo &a, const std::string &exportDef)
 
void generateDescriptorClass (const ClassInfo &a)
 
void generateEnum (const EnumInfo &enumInfo)
 
void generateImport (const std::string &importName)
 
void generateNamespaceBegin (const std::string &namespaceName, bool intoCcFile=true)
 
void generateNamespaceEnd (const std::string &namespaceName, bool intoCcFile=true)
 
void generateTypeAnnouncement (const ClassInfo &classInfo)
 
std::string generatePreComment (ASTNode *nedElement)
 
void generateHeaderCplusplusBlock (const std::string &body)
 
void generateImplCplusplusBlock (const std::string &body)
 

Protected Member Functions

std::string prefixWithNamespace (const std::string &name, const std::string &namespaceName)
 
std::string makeFuncall (const std::string &var, bool isPointer, const std::string &funcTemplate, bool withIndex=false, const std::string &value="")
 
void generateOwnershipOp (const FieldInfo &field, const std::string &var, const std::string &op)
 
void generateClassDecl (const ClassInfo &classInfo, const std::string &exportDef)
 
void generateClassImpl (const ClassInfo &classInfo)
 
void generateStructDecl (const ClassInfo &classInfo, const std::string &exportDef)
 
void generateStructImpl (const ClassInfo &classInfo)
 
void generateCplusplusBlock (std::ofstream &out, const std::string &body)
 
void generateMethodCplusplusBlock (const ClassInfo &classInfo, const std::string &method)
 
void reportUnusedMethodCplusplusBlocks (const ClassInfo &classInfo)
 
void generateDelegationForBaseClassFields (const std::string &code)
 

Protected Attributes

std::string hFilename
 
std::string ccFilename
 
std::ofstream hStream
 
std::ofstream ccStream
 
std::string headerGuard
 
ErrorStoreerrors
 

Member Typedef Documentation

◆ StringVector

typedef std::vector<std::string> StringVector

◆ Properties

◆ FieldInfo

◆ ClassInfo

◆ EnumItem

◆ EnumInfo

Constructor & Destructor Documentation

◆ MsgCodeGenerator()

MsgCodeGenerator ( ErrorStore errors)
inline

Member Function Documentation

◆ prefixWithNamespace()

std::string prefixWithNamespace ( const std::string &  name,
const std::string &  namespaceName 
)
protected

◆ makeFuncall()

std::string makeFuncall ( const std::string &  var,
bool  isPointer,
const std::string &  funcTemplate,
bool  withIndex = false,
const std::string &  value = "" 
)
protected

◆ generateOwnershipOp()

void generateOwnershipOp ( const FieldInfo field,
const std::string &  var,
const std::string &  op 
)
protected

◆ generateClassDecl()

void generateClassDecl ( const ClassInfo classInfo,
const std::string &  exportDef 
)
protected

◆ generateClassImpl()

void generateClassImpl ( const ClassInfo classInfo)
protected

◆ generateStructDecl()

void generateStructDecl ( const ClassInfo classInfo,
const std::string &  exportDef 
)
protected

◆ generateStructImpl()

void generateStructImpl ( const ClassInfo classInfo)
protected

◆ generateCplusplusBlock()

void generateCplusplusBlock ( std::ofstream &  out,
const std::string &  body 
)
protected

◆ generateMethodCplusplusBlock()

void generateMethodCplusplusBlock ( const ClassInfo classInfo,
const std::string &  method 
)
protected

◆ reportUnusedMethodCplusplusBlocks()

void reportUnusedMethodCplusplusBlocks ( const ClassInfo classInfo)
protected

◆ generateDelegationForBaseClassFields()

void generateDelegationForBaseClassFields ( const std::string &  code)
protected

◆ openFiles()

void openFiles ( const char *  hFile,
const char *  ccFile 
)

◆ closeFiles()

void closeFiles ( )

◆ deleteFiles()

void deleteFiles ( )

◆ generateProlog()

void generateProlog ( const std::string &  msgFileName,
const std::string &  firstNamespace,
const std::string &  exportDef 
)

◆ generateEpilog()

void generateEpilog ( )

◆ generateClass()

void generateClass ( const ClassInfo classInfo,
const std::string &  exportDef 
)

◆ generateStruct()

void generateStruct ( const ClassInfo classInfo,
const std::string &  exportDef 
)

◆ generateToAnyPtr()

void generateToAnyPtr ( const ClassInfo a)

◆ generateFromAnyPtr()

void generateFromAnyPtr ( const ClassInfo a,
const std::string &  exportDef 
)

◆ generateDescriptorClass()

void generateDescriptorClass ( const ClassInfo a)

◆ generateEnum()

void generateEnum ( const EnumInfo enumInfo)

◆ generateImport()

void generateImport ( const std::string &  importName)

◆ generateNamespaceBegin()

void generateNamespaceBegin ( const std::string &  namespaceName,
bool  intoCcFile = true 
)

◆ generateNamespaceEnd()

void generateNamespaceEnd ( const std::string &  namespaceName,
bool  intoCcFile = true 
)

◆ generateTypeAnnouncement()

void generateTypeAnnouncement ( const ClassInfo classInfo)

◆ generatePreComment()

std::string generatePreComment ( ASTNode nedElement)

◆ generateHeaderCplusplusBlock()

void generateHeaderCplusplusBlock ( const std::string &  body)

◆ generateImplCplusplusBlock()

void generateImplCplusplusBlock ( const std::string &  body)

Member Data Documentation

◆ hFilename

std::string hFilename
protected

◆ ccFilename

std::string ccFilename
protected

◆ hStream

std::ofstream hStream
protected

◆ ccStream

std::ofstream ccStream
protected

◆ headerGuard

std::string headerGuard
protected

◆ errors

ErrorStore* errors
protected

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