Example #1
0
 def getBody(self) :
     if self.static :
         if util.inherits(self.subfield.data_type, dbtypes.ClassType) :
             return "{ " + "return {0}(staticData().{1}.{2});".format(util.getPublicTypeName(self.subfield.data_type, out_of_ns = False), self.field_name, self.subfield_name) + " }"
         return "{ return staticData()." + self.field_name + "." + self.subfield_name + "; }"
     if util.inherits(self.subfield.data_type, dbtypes.ClassType) :
         return "{ return " + "{0}(getInstance().{1}.{2});".format(util.getPublicTypeName(self.subfield.data_type, out_of_ns = False), self.field_name, self.subfield_name) + " }"
     return "{ return " + "getInstance()." + self.field_name + "." + self.subfield_name + "; }"
Example #2
0
 def getBody(self) :
     result = "{\n"
     result += "    for(StdUInt i = 0; i < count; i++)\n"
     if util.inherits(self.field.data_type, dbtypes.ClassType) :
         result += "        dest[i] = {0}(geti{1}(i));\n".format(util.getPublicTypeName(self.field.data_type), self.field_name)
     else :
         result += "        dest[i] = geti{1}(i);\n".format(self.field.data_type.__name__, self.field_name)
     result += "}\n"
     return result
Example #3
0
 def getArgs(self) :
     if isinstance(self.args, str) :
         return self.args
     result = ""
     arg_names = sorted(self.args.keys())
     for arg_name in arg_names :
         arg_type = self.args[arg_name]
         if isinstance(arg_type, str) :
             result += "{0} {1}, ".format(arg_type, arg_name)
         elif util.inherits(arg_type, dbtypes.ClassType) :
             if arg_name[0] == '*' :
                 result += "{0} {1}, ".format(util.getPublicTypeName(arg_type, out_of_ns = False), arg_name)
             else :
                 result += "const {0} & {1}, ".format(util.getPublicTypeName(arg_type, out_of_ns = False), arg_name)
         else :
             result += "{0} {1}, ".format(util.getPublicTypeName(arg_type, out_of_ns = False), arg_name)
     if len(result) != 0 and result[-2] == ',' :
         result = result[:-2]
     return result
Example #4
0
 def getInclassSignature(self) :
     result = "    "
     if self.static :
         result += "static "
     elif self.inline :
         result += "inline "
     if isinstance(self.data_type, str) :
         result += self.data_type + " "
     else :
         result += util.getPublicTypeName(self.data_type, out_of_ns = False) + " "
     result += self.name + " ( " + self.getArgs() + " ) "
     if not self.static and self.const :
         result += "const "
     return result
Example #5
0
 def getOutclassSignature(self) :
     result = ""
     if not self.static and self.inline :
         result += "inline "
     ## Результат функции
     if isinstance(self.data_type, str) :
         result += self.data_type + " "
     else :
         result += util.getPublicTypeName(self.data_type, out_of_ns = True) + " "
     ## имя метода
     result += "{0}::{1}::{2}({3}) ".format(dbtypes.HSDB.prefix,
                                             self.parent.__name__,
                                             self.name,
                                             self.getArgs())
     if not self.static and self.const :
         result += "const "
     return result
Example #6
0
 def getBody(self) :
     if util.inherits(self.field.data_type, dbtypes.ClassType) :
         return "{ return " + "{0}(get{1}Ptr()[index]);".format(util.getPublicTypeName(self.field.data_type), self.field_name) + " }"
     return "{ return " + "get{0}Ptr()[index];".format(self.field_name) + " }"