Code-generator common base class. More...
Go to the source code of this file.
Classes | |
| class | CodeGenerator |
| Code-generation common base. More... | |
| struct | CodeGenerator::LineAddress |
| Compiled record per input line. More... | |
| struct | CodeGenerator::FlagExpression |
| Compiled record per input flag-expression. More... | |
| struct | CodeGenerator::TimerConfiguration |
| Compiled record per timer acting. More... | |
| struct | CodeGenerator::ActionAddress |
| Compiled record per action-address. More... | |
| class | CodeGenerator::TimerAction |
| Compiled record per event on how it affects timers. More... | |
| class | CodeGenerator::Registration< T > |
| Registration class. More... | |
Macros | |
| #define | FCG_VERB0(msg) { if(mVerbLevel>=0) *pErrStream << msg << std::endl; } |
| #define | FCG_VERB1(msg) { if(mVerbLevel>=1) *pErrStream << msg << std::endl; } |
| #define | FCG_VERB2(msg) { if(mVerbLevel>=2) *pErrStream << msg << std::endl; } |
| #define | FCG_ERR(msg) { *pErrStream << msg << std::endl; throw Exception("CodeGenerator()","internal error", 500); } |
| #define | COMPILEDES_VERSION "3.xx" |
Code-Generator Registry | |
Derived classes register via a static registration mechanism to provide an application-invokable constructor. The static registry records the constructor with a std::string typename as identifier. The purpose of this mechanism is to instantiate derived classes by their identifier at runtime.E.g. static CodeGenerator * New(const std::string &type) Instantiate by identifier (returns 0 on unknown class) Definition cgp_codegenerator.cpp:63 instantiates a CodeGenerator object of the type registered by "iec". See the command-line tool compiledes.cpp for a relevant use case. Registration can be conveniently triggered by instantiation of a CodeGenerator::Registration object via the provided macro. E.g. in the source that defines the class IecCodeGenerator FAUDES_REGISTERCODEGENERATOR("iec",IecCodeGenerator);
#define FAUDES_REGISTERCODEGENERATOR(ftype, ctype) Class registration macro. Definition cgp_codegenerator.h:831 is used to register the respective class with the identifier "iec". | |
| #define | FAUDES_REGISTERCODEGENERATOR(ftype, ctype) static CodeGenerator::Registration<ctype> gRegister(ftype) |
| Class registration macro. | |
| struct CodeGenerator::LineAddress |
Definition at line 472 of file cgp_codegenerator.h.
| struct CodeGenerator::FlagExpression |
Definition at line 489 of file cgp_codegenerator.h.
| Class Members | ||
|---|---|---|
| string | mAddress | target expression to represent the line value |
| EventSet | mEvents | events to trigger on positive evaluation |
| struct CodeGenerator::TimerConfiguration |
Definition at line 504 of file cgp_codegenerator.h.
| Class Members | ||
|---|---|---|
| string | mAddress | target address prefix to maintain timer state |
| string | mElapseEvent |
event to trigger on timer elapse |
| string | mInitialValue | target representation of initial value |
| EventSet | mStartEvents | start events as in AttributeCodeGeneratorEvent |
| EventSet | mStopEvents | stop events as in AttributeCodeGeneratorEvent |
| EventSet | mResetEvents | reset events as in AttributeCodeGeneratorEvent |
| struct CodeGenerator::ActionAddress |
Definition at line 538 of file cgp_codegenerator.h.
| Class Members | ||
|---|---|---|
| string | mAddress | target address as specified in configuration |
| bool | mSetClr | is a set/clr type of address |
| bool | mExe | is an executable type of address |
| #define FCG_VERB0 | ( | msg | ) | { if(mVerbLevel>=0) *pErrStream << msg << std::endl; } |
Definition at line 23 of file cgp_codegenerator.h.
| #define FCG_VERB1 | ( | msg | ) | { if(mVerbLevel>=1) *pErrStream << msg << std::endl; } |
Definition at line 24 of file cgp_codegenerator.h.
| #define FCG_VERB2 | ( | msg | ) | { if(mVerbLevel>=2) *pErrStream << msg << std::endl; } |
Definition at line 25 of file cgp_codegenerator.h.
| #define FCG_ERR | ( | msg | ) | { *pErrStream << msg << std::endl; throw Exception("CodeGenerator()","internal error", 500); } |
Definition at line 26 of file cgp_codegenerator.h.
| #define COMPILEDES_VERSION "3.xx" |
Definition at line 30 of file cgp_codegenerator.h.
| #define FAUDES_REGISTERCODEGENERATOR | ( | ftype, | |
| ctype | |||
| ) | static CodeGenerator::Registration<ctype> gRegister(ftype) |
Definition at line 831 of file cgp_codegenerator.h.