#include <iopcTranslator.h>
Inheritance diagram for IopcTranslator:
Public Member Functions | |
virtual void | TranslateClass (Environment *env) |
virtual void | TranslateMemberFunction (Environment *env, Member &member) |
virtual Ptree * | TranslateMemberRead (Environment *env, Ptree *object, Ptree *access_op, Ptree *member) |
virtual Ptree * | TranslateMemberRead (Environment *env, Ptree *member) |
virtual Ptree * | TranslateMemberWrite (Environment *env, Ptree *object, Ptree *access_op, Ptree *member, Ptree *assign_op, Ptree *expr) |
virtual Ptree * | TranslateMemberWrite (Environment *env, Ptree *member, Ptree *assign_op, Ptree *expr) |
virtual Ptree * | TranslatePostfixOnMember (Environment *env, Ptree *object, Ptree *access_op, Ptree *member, Ptree *postfix_op) |
virtual Ptree * | TranslatePostfixOnMember (Environment *env, Ptree *member, Ptree *postfix_op) |
virtual Ptree * | TranslateUnaryOnMember (Environment *env, Ptree *unary_op, Ptree *object, Ptree *access_op, Ptree *member) |
virtual Ptree * | TranslateUnaryOnMember (Environment *env, Ptree *unary_op, Ptree *member) |
Protected Member Functions | |
Ptree * | TranslateMemberReadImpl (Environment *env, Ptree *member, Ptree *object=NULL, Ptree *accessOp=NULL) |
Ptree * | TranslateMemberWriteImpl (Environment *env, Ptree *member, Ptree *assignOp, Ptree *expr, Ptree *object=NULL, Ptree *accessOp=NULL) |
Ptree * | TranslatePostfixOnMemberImpl (Environment *env, Ptree *member, Ptree *postfixOp, Ptree *object=NULL, Ptree *accessOp=NULL) |
Ptree * | TranslateUnaryOnMemberImpl (Environment *env, Ptree *member, Ptree *unaryOp, Ptree *object=NULL, Ptree *accessOp=NULL) |
void | PrintTranslationError (Environment *env, Ptree *where, const char *format,...) |
CStdString | GetQualifiedClassName (Environment *env) |
int | TestPersistence (Ptree *member, char *&className, char *&attrName, char *&namespaceOrClassSpecification) |
Static Protected Member Functions | |
CStdString | GetFileAndLineNumber (Ptree *tree, Environment *env) |
Protected Attributes | |
bool | isInDestructor |
Static Protected Attributes | |
GeneralClassMap | allClassesMap |
IopcTranslatingSupport | translatingSupport |
The first goal of this class is to gather information about source file object model (classes, attributes, inheritance) and then store them as mapping metadata (using MetadataWriter). The second goal is to add methods needed to make a class persistent to all the ancestors of IopcPersistentObject
. The implementation of these methods is created by calls to IopcTranslatingSupport (translatingSupport).
If TranslateMemberRead(), TranslateMemberWrite(), TranslatePostfixOnMember() or TranslateUnaryOnMember() is called for some code from a class destructor, the attributes in translated code are accessed directly, not using getters and setters. The reason is that we don't want to load attributes (strings) from the database in destructor. Without this "exception" typical string destruction code "if (str != NULL) delete str;"
would cause loading str
from DB.
|
Translates declaration of whole class.
Reimplemented from Class. |
|
Translates declaration of a member function. This function is called both for functions declared inline in class declaration and for functions declared out of the class declaration.
Reimplemented from Class. |
|
Translates read access to an attribute. Called if the attribute is accessed using object name - i.e. something like "object.attr" or "object->attr". Implemented as a call to TranslateMemberReadImpl().
Reimplemented from Class. |
|
Translates read access to an attribute. Called if the attribute is accessed using attribute name separately - i.e. something like "attr" (not "object.attr" or "object->attr"). Implemented as a call to TranslateMemberReadImpl().
Reimplemented from Class. |
|
Translates write access to an attribute. Called if the attribute is accessed using object name - i.e. something like "object.attr" or "object->attr". Implemented as a call to TranslateMemberWriteImpl().
Reimplemented from Class. |
|
Translates write access to an attribute. Called if the attribute is accessed using attribute name separately - i.e. something like "attr" (not "object.attr" or "object->attr"). Implemented as a call to TranslateMemberWriteImpl().
Reimplemented from Class. |
|
Translates a postfix operator applied to some attribute. Called if the attribute is accessed using object name - i.e. something like "object.attr" or "object->attr". Implemented as a call to TranslatePostfixOnMemberImpl().
Reimplemented from Class. |
|
Translates a postfix operator applied to some attribute. Called if the attribute is accessed using attribute name separately - i.e. something like "attr" (not "object.attr" or "object->attr"). Implemented as a call to TranslatePostfixOnMemberImpl().
Reimplemented from Class. |
|
Translates a prefix unary operator applied to some attribute. Called if the attribute is accessed using object name - i.e. something like "object.attr" or "object->attr". Implemented as a call to TranslateUnaryOnMemberImpl().
Reimplemented from Class. |
|
Translates a prefix unary operator applied to some attribute. Called if the attribute is accessed using attribute name separately - i.e. something like "attr" (not "object.attr" or "object->attr"). Implemented as a call to TranslateUnaryOnMemberImpl().
Reimplemented from Class. |
|
Translates read access to an attribute.
Uses TestPersistence() and IopcTranslatingSupport::createGetterCall().
|
|
Translates write access to an attribute.
Uses TestPersistence(), IopcTranslatingSupport::createGetterCall() and IopcTranslatingSupport::createSetterCall().
|
|
Translates a postfix operator applied to some attribute.
Uses TestPersistence(), IopcTranslatingSupport::createGetterCall() and IopcTranslatingSupport::createSetterCall().
|
|
Translates a prefix unary operator applied to some attribute.
|
|
Called to print an error message if some error occures during translation.
Formats message given by
|
|
Gets file name and line number as string - returns something like
|
|
Gets qualified name of class, whose code / member is currently translated.
To be used on nested classes and in namespaces. Walks through the hierarchy of Environment-s starting from
|
|
Tests whether
If so, returns name of the class ( It is not necessary to dealocate returned string because IOPC SP / OpenC++ uses garbage collector.
|
|
Map containing all classes already seen in the file - its purpose is described GeneralClassMap's documentation. |
|
Pointer to class that is able to generate implementations of methods that are needed to make a class persistent. |
|
Is IOPC SP currently translating a destructor? Set and reset in TranslateMemberFunction(). In a persistent class's destructor accesses to persistent attributes are not translated to access methods calls - we don't want to uselessly load long strings from the database in destructor. Instead of it the accesses are translated to direct accesses to attribute (of the modified name). |