#include <iopcTranslatingSupport.h>
Inheritance diagram for IopcTranslatingSupport:
Public Member Functions | |
Ptree * | createAttributeDeclaration (const char *className, const char *attrName, TypeInfo &typeInfo) |
void | createGettersAndSetters (const char *className, CStdString &getters, CStdString &setters) |
CStdString | createInitObjectFnc (const char *className) |
CStdString | createExportAttributesFnc (const char *className) |
CStdString | createImportAttributesFnc (const char *className) |
CStdString | createCreateInstanceFnc (const char *className) |
CStdString | createCreateReferenceFnc (const char *className) |
CStdString | createClassNameFnc (const char *className) |
CStdString | createClassRegistrarInstance (const char *className, const char *qualifiedClassName) |
Ptree * | createGetterCall (const char *className, const char *attrName, const char *fullClassQualification, Ptree *object, Ptree *op) |
Ptree * | createSetterCall (const char *className, const char *attrName, const char *fullClassQualification, Ptree *translatedExpr, Ptree *object, Ptree *op) |
void | sendClassToMetadataWriter (const char *className) |
Protected Member Functions | |
CStdString | createGetter (const char *className, const char *attrName, IopcAttributeInfo *attrInfo, int attrNumber) |
CStdString | createSetter (const char *className, const char *attrName, IopcAttributeInfo *attrInfo, int attrNumber) |
Static Protected Member Functions | |
const char * | getImportExportStructField (IopcDataType dataType) |
This class is inherited from IopcPcClassStore - so it works as a store for information about persistent classes.
The new functionality in this class is ability to generate methods needed to make a class persistent capable. This functionality is used by IopcTranslator.
|
Generates declaration of attribute and its indicator variable. Because in OpenC++ it is not possible to change access specifier of a variable, persistent atributes declared by user cannot be simply renamed but it is necessary to remove them and add the renamed attributes with access specifier "private".
|
|
Generates getters and setters for all potentially persistent attributes of class Traverses class's attributes and calls for each of them createSetter() and createGetter().
|
|
Generates method The generated method can look like this:
The only parameter of the generated method specifies whether we are loading the object from the database or not. The indicator variables are set according to it.
|
|
Generates method
If type of an attribute is IOPC_COMPLEX_DATA_TYPE, The generated method can look like this:
|
|
Generates method
If type of an attribute is IOPC_COMPLEX_DATA_TYPE, The generated method can look like this:
|
|
Generates method
The method is used by IOPC LIB's class IopcClassFactory and related stuff to provide query and reference polymorphism.
|
|
Generates method
The method is used by IOPC LIB's class IopcClassFactory and related stuff for example when traversing results of a query.
|
|
Creates simple function Example of the generated code:
|
|
Generates definition of template Example of the generated code:
|
|
Simple function that returns source code which calls getter of the specified attribute. Example of function's result:
|
|
Simple function that returns source code which calls setter of the specified attribute. Example of function's result:
|
|
Sends information about class given by Finds the class in its internal structures (getClass()) and sends data about it to MetadataWriter (MetadataWriter::addClass()).
|
|
Creates getter for specified attribute. Getter is method that returns value of an attribute. If the attribute is persistent and its value is not in memory (appropriate indicator variable is "false"), loads the value from database (using IOPC LIB's IopcClassObjectImpl::loadAttribute()). Example of the getter:
|
|
Creates setter for specified attribute. Setter is method that sets value of an attribute. Attribute's indicator variable is set to "true". If the object is persistent, dirty flag is set. Example of the setter:
|
|
For given data type returns field of IopcImportExportStruct's union, which should be used when storing attributes of given type.
|