MsgCppGenerator Class Reference
[Generating NED]
Generates C++ code from a MSG file object tree.
More...
#include <msgcppgenerator.h>
List of all members.
Classes |
| class | ClassInfo |
| class | EnumInfo |
| struct | TypeDesc |
Public Types |
| enum | ClassType {
UNKNOWN = 0,
STRUCT,
COBJECT,
COWNEDOBJECT,
CNAMEDOBJECT,
FOREIGN
} |
| typedef std::vector< std::string > | StringVector |
Public Member Functions |
| | MsgCppGenerator (NEDErrorStore *errors, const MsgCppGeneratorOptions &options) |
| | ~MsgCppGenerator () |
| void | generate (MsgFileElement *fileElement, const char *hFile, const char *ccFile) |
Protected Types |
typedef std::map< std::string,
TypeDesc > | TypeMap |
typedef std::map< std::string,
std::string > | Properties |
Protected Member Functions |
| std::string | prefixWithNamespace (const std::string &s) |
| StringVector | lookupExistingClassName (const std::string &s) |
| StringVector | lookupExistingEnumName (const std::string &s) |
| bool | isClassDeclared (const std::string &s) |
| ClassType | getClassType (const std::string &s) |
| ClassInfo | extractClassInfo (NEDElement *node) |
| void | extractClassDecl (NEDElement *node) |
| Properties | extractPropertiesOf (NEDElement *node) |
| void | prepareFieldForCodeGeneration (ClassInfo &info, ClassInfo::FieldInfo *it) |
| void | prepareForCodeGeneration (ClassInfo &classInfo) |
| EnumInfo | extractEnumInfo (EnumElement *node) |
| void | generateClass (const ClassInfo &classInfo) |
| void | generateStruct (const ClassInfo &classInfo) |
| void | generateDescriptorClass (const ClassInfo &a) |
| void | generateEnum (const EnumInfo &enumInfo) |
| void | generateNamespaceBegin (NEDElement *element) |
| void | generateNamespaceEnd () |
| std::string | generatePreComment (NEDElement *nedElement) |
| void | generateTemplates () |
| bool | getPropertyAsBool (const Properties &p, const char *name, bool defval) |
| std::string | getProperty (const Properties &p, const char *name, const std::string &defval=std::string()) |
| void | generate (MsgFileElement *fileElement) |
Protected Attributes |
| std::string | hFilename |
| std::string | ccFilename |
| std::ostream * | hOutp |
| std::ostream * | ccOutp |
| NEDErrorStore * | errors |
| std::map< std::string, ClassType > | classtype |
std::map< std::string,
std::string > | enumtype |
| std::string | namespacename |
| StringVector | namespacenamevector |
| MsgCppGeneratorOptions | opts |
Static Protected Attributes |
| static const TypeMap | PRIMITIVE_TYPES |
Detailed Description
Generates C++ code from a MSG file object tree.
Assumes object tree has already passed all validation stages (DTD, syntax, semantic).
Member Typedef Documentation
Member Enumeration Documentation
- Enumerator:
| UNKNOWN |
|
| STRUCT |
|
| COBJECT |
|
| COWNEDOBJECT |
|
| CNAMEDOBJECT |
|
| FOREIGN |
|
Constructor & Destructor Documentation
| MsgCppGenerator::~MsgCppGenerator |
( |
|
) |
|
Member Function Documentation
| void MsgCppGenerator::extractClassDecl |
( |
NEDElement * |
node |
) |
[protected] |
| void MsgCppGenerator::generate |
( |
MsgFileElement * |
fileElement, |
|
|
const char * |
hFile, |
|
|
const char * |
ccFile | |
|
) |
| | |
| void MsgCppGenerator::generate |
( |
MsgFileElement * |
fileElement |
) |
[protected] |
Generates C++ code from the specified message file.
Assumes object tree has already passed DTD and syntax validation.
| void MsgCppGenerator::generateClass |
( |
const ClassInfo & |
classInfo |
) |
[protected] |
| void MsgCppGenerator::generateDescriptorClass |
( |
const ClassInfo & |
a |
) |
[protected] |
| void MsgCppGenerator::generateEnum |
( |
const EnumInfo & |
enumInfo |
) |
[protected] |
| void MsgCppGenerator::generateNamespaceBegin |
( |
NEDElement * |
element |
) |
[protected] |
| void MsgCppGenerator::generateNamespaceEnd |
( |
|
) |
[protected] |
| std::string MsgCppGenerator::generatePreComment |
( |
NEDElement * |
nedElement |
) |
[protected] |
| void MsgCppGenerator::generateStruct |
( |
const ClassInfo & |
classInfo |
) |
[protected] |
| void MsgCppGenerator::generateTemplates |
( |
|
) |
[protected] |
| ClassType MsgCppGenerator::getClassType |
( |
const std::string & |
s |
) |
[protected] |
| std::string MsgCppGenerator::getProperty |
( |
const Properties & |
p, |
|
|
const char * |
name, |
|
|
const std::string & |
defval = std::string() | |
|
) |
| | [protected] |
| bool MsgCppGenerator::getPropertyAsBool |
( |
const Properties & |
p, |
|
|
const char * |
name, |
|
|
bool |
defval | |
|
) |
| | [protected] |
| bool MsgCppGenerator::isClassDeclared |
( |
const std::string & |
s |
) |
[inline, protected] |
| StringVector MsgCppGenerator::lookupExistingClassName |
( |
const std::string & |
s |
) |
[protected] |
| StringVector MsgCppGenerator::lookupExistingEnumName |
( |
const std::string & |
s |
) |
[protected] |
| std::string MsgCppGenerator::prefixWithNamespace |
( |
const std::string & |
s |
) |
[protected] |
| void MsgCppGenerator::prepareForCodeGeneration |
( |
ClassInfo & |
classInfo |
) |
[protected] |
Member Data Documentation
The documentation for this class was generated from the following file: