• Home
  • Raw
  • Download

Lines Matching refs:struct_def

76       auto &struct_def = **it;  in generate()  local
78 cur_name_space_ = struct_def.defined_namespace; in generate()
79 GenStruct(struct_def, &declcode, parser_.opts); in generate()
83 if (!SaveType(struct_def.name, *struct_def.defined_namespace, declcode, in generate()
139 return "Offset<" + WrapInNameSpace(*type.struct_def) + ">"; in GenTypeBasic()
154 case BASE_TYPE_STRUCT: return WrapInNameSpace(*type.struct_def); in GenTypePointer()
167 std::string GenOffsetType(const StructDef &struct_def) const { in GenOffsetType()
168 return "Offset<" + WrapInNameSpace(struct_def) + ">"; in GenOffsetType()
171 std::string GenOffsetConstruct(const StructDef &struct_def, in GenOffsetConstruct() argument
173 return "new Offset<" + WrapInNameSpace(struct_def) + ">(" + variable_name + in GenOffsetConstruct()
255 return "default(Offset<" + WrapInNameSpace(*value.type.struct_def) + in GenDefaultValueBasic()
383 void GenStructArgs(const StructDef &struct_def, std::string *code_ptr, in GenStructArgs() argument
386 for (auto it = struct_def.fields.vec.begin(); in GenStructArgs()
387 it != struct_def.fields.vec.end(); ++it) { in GenStructArgs()
397 GenStructArgs(*field_type.struct_def, code_ptr, in GenStructArgs()
418 void GenStructBody(const StructDef &struct_def, std::string *code_ptr, in GenStructBody() argument
424 code += NumToString(struct_def.minalign) + ", "; in GenStructBody()
425 code += NumToString(struct_def.bytesize) + ");\n"; in GenStructBody()
426 for (auto it = struct_def.fields.vec.rbegin(); in GenStructBody()
427 it != struct_def.fields.vec.rend(); ++it) { in GenStructBody()
435 GenStructBody(*field_type.struct_def, code_ptr, in GenStructBody()
449 GenStructBody(*field_type.struct_def, code_ptr, in GenStructBody()
521 void GenStruct(StructDef &struct_def, std::string *code_ptr, in GenStruct() argument
523 if (struct_def.generated) return; in GenStruct()
532 GenComment(struct_def.doc_comment, code_ptr, &comment_config); in GenStruct()
533 if (struct_def.attributes.Lookup("private")) { in GenStruct()
538 if (struct_def.attributes.Lookup("csharp_partial")) { in GenStruct()
542 code += "struct " + struct_def.name; in GenStruct()
546 code += struct_def.fixed ? "Struct" : "Table"; in GenStruct()
551 if (!struct_def.fixed) { in GenStruct()
561 std::string method_name = "GetRootAs" + struct_def.name; in GenStruct()
563 " public static " + struct_def.name + " " + method_name; in GenStruct()
567 code += "{ return " + method_name + "(_bb, new " + struct_def.name + in GenStruct()
572 method_signature + "(ByteBuffer _bb, " + struct_def.name + " obj) { "; in GenStruct()
576 if (parser_.root_struct_def_ == &struct_def) { in GenStruct()
580 code += "bool " + struct_def.name; in GenStruct()
593 code += struct_def.fixed ? "Struct" : "Table"; in GenStruct()
597 " public " + struct_def.name + " __assign(int _i, ByteBuffer _bb) "; in GenStruct()
599 for (auto it = struct_def.fields.vec.begin(); in GenStruct()
600 it != struct_def.fields.vec.end(); ++it) { in GenStruct()
608 if (!struct_def.fixed && in GenStruct()
666 if (struct_def.fixed) { in GenStruct()
682 if (struct_def.fixed) { in GenStruct()
689 code += field.value.type.struct_def->fixed in GenStruct()
728 code += vectortype.struct_def->fixed in GenStruct()
777 val->union_type.struct_def->attributes.Lookup("private")) { in GenStruct()
807 !field.value.type.struct_def->fixed) { in GenStruct()
808 auto &sd = *field.value.type.struct_def; in GenStruct()
923 : (struct_def.fixed in GenStruct()
928 code += struct_def.fixed ? "void " : "bool "; in GenStruct()
931 if (struct_def.fixed) { in GenStruct()
944 IsScalar(field.value.type.base_type) && !struct_def.fixed) { in GenStruct()
957 if (struct_def.fixed) { in GenStruct()
960 code += " public static " + GenOffsetType(struct_def) + " "; in GenStruct()
962 code += struct_def.name + "(FlatBufferBuilder builder"; in GenStruct()
963 GenStructArgs(struct_def, code_ptr, ""); in GenStruct()
965 GenStructBody(struct_def, code_ptr, ""); in GenStruct()
967 code += GenOffsetConstruct(struct_def, "builder.Offset"); in GenStruct()
975 for (auto it = struct_def.fields.vec.begin(); in GenStruct()
976 it != struct_def.fields.vec.end(); ++it) { in GenStruct()
992 code += " public static " + GenOffsetType(struct_def) + " "; in GenStruct()
993 code += "Create" + struct_def.name; in GenStruct()
995 for (auto it = struct_def.fields.vec.begin(); in GenStruct()
996 it != struct_def.fields.vec.end(); ++it) { in GenStruct()
1002 field.value.type.struct_def->defined_namespace, in GenStruct()
1003 GenTypeName_ObjectAPI(field.value.type.struct_def->name, opts)); in GenStruct()
1020 code += NumToString(struct_def.fields.vec.size()) + ");\n"; in GenStruct()
1021 for (size_t size = struct_def.sortbysize ? sizeof(largest_scalar_t) : 1; in GenStruct()
1023 for (auto it = struct_def.fields.vec.rbegin(); in GenStruct()
1024 it != struct_def.fields.vec.rend(); ++it) { in GenStruct()
1027 (!struct_def.sortbysize || in GenStruct()
1029 code += " " + struct_def.name + "."; in GenStruct()
1045 code += " return " + struct_def.name + "."; in GenStruct()
1046 code += "End" + struct_def.name; in GenStruct()
1055 code += struct_def.name; in GenStruct()
1058 code += NumToString(struct_def.fields.vec.size()) + "); }\n"; in GenStruct()
1059 for (auto it = struct_def.fields.vec.begin(); in GenStruct()
1060 it != struct_def.fields.vec.end(); ++it) { in GenStruct()
1073 code += NumToString(it - struct_def.fields.vec.begin()) + ", "; in GenStruct()
1138 code += " public static " + GenOffsetType(struct_def) + " "; in GenStruct()
1139 code += "End" + struct_def.name; in GenStruct()
1142 for (auto it = struct_def.fields.vec.begin(); in GenStruct()
1143 it != struct_def.fields.vec.end(); ++it) { in GenStruct()
1151 code += " return " + GenOffsetConstruct(struct_def, "o") + ";\n }\n"; in GenStruct()
1152 if (parser_.root_struct_def_ == &struct_def) { in GenStruct()
1156 code += "Finish" + size_prefix[i] + struct_def.name; in GenStruct()
1158 "Buffer(FlatBufferBuilder builder, " + GenOffsetType(struct_def); in GenStruct()
1171 if (struct_def.has_key && !struct_def.fixed) { in GenStruct()
1174 code += "CreateSortedVectorOf" + struct_def.name; in GenStruct()
1176 code += "Offset<" + struct_def.name + ">"; in GenStruct()
1178 code += " Array.Sort(offsets, (Offset<" + struct_def.name + in GenStruct()
1179 "> o1, Offset<" + struct_def.name + "> o2) => " + in GenStruct()
1184 code += "\n public static " + struct_def.name + "?"; in GenStruct()
1207 code += "new " + struct_def.name + "()"; in GenStruct()
1215 GenPackUnPack_ObjectAPI(struct_def, code_ptr, opts, struct_has_create, in GenStruct()
1221 GenStruct_ObjectAPI(struct_def, code_ptr, opts); in GenStruct()
1225 void GenVectorAccessObject(StructDef &struct_def, in GenVectorAccessObject() argument
1231 if (!struct_def.attributes.Lookup("private")) code += "public "; in GenVectorAccessObject()
1241 auto type_name = struct_def.name; in GenVectorAccessObject()
1248 code += struct_def.fixed ? "__p.__element(j)" in GenVectorAccessObject()
1252 if (!struct_def.fixed) { in GenVectorAccessObject()
1253 auto &fields = struct_def.fields.vec; in GenVectorAccessObject()
1314 ev.union_type.struct_def->attributes.Lookup("private")) { in GenEnum_ObjectAPI()
1485 StructDef &struct_def, std::string *code_ptr, const IDLOptions &opts, in GenPackUnPack_ObjectAPI() argument
1489 auto struct_name = GenTypeName_ObjectAPI(struct_def.name, opts); in GenPackUnPack_ObjectAPI()
1498 for (auto it = struct_def.fields.vec.begin(); in GenPackUnPack_ObjectAPI()
1499 it != struct_def.fields.vec.end(); ++it) { in GenPackUnPack_ObjectAPI()
1506 auto fixed = struct_def.fixed && field.value.type.struct_def->fixed; in GenPackUnPack_ObjectAPI()
1518 auto unpack_method = field.value.type.struct_def == nullptr in GenPackUnPack_ObjectAPI()
1520 : field.value.type.struct_def->fixed in GenPackUnPack_ObjectAPI()
1540 auto fixed = field.value.type.struct_def == nullptr; in GenPackUnPack_ObjectAPI()
1569 code += " public static " + GenOffsetType(struct_def) + in GenPackUnPack_ObjectAPI()
1571 code += " if (_o == null) return default(" + GenOffsetType(struct_def) + in GenPackUnPack_ObjectAPI()
1573 for (auto it = struct_def.fields.vec.begin(); in GenPackUnPack_ObjectAPI()
1574 it != struct_def.fields.vec.end(); ++it) { in GenPackUnPack_ObjectAPI()
1581 if (!field.value.type.struct_def->fixed) { in GenPackUnPack_ObjectAPI()
1584 GenOffsetType(*field.value.type.struct_def) + in GenPackUnPack_ObjectAPI()
1587 } else if (struct_def.fixed && struct_has_create) { in GenPackUnPack_ObjectAPI()
1594 GenStructPackDecl_ObjectAPI(*field.value.type.struct_def, code_ptr, in GenPackUnPack_ObjectAPI()
1658 field.value.type.struct_def == nullptr in GenPackUnPack_ObjectAPI()
1675 if (field.value.type.struct_def != nullptr) { in GenPackUnPack_ObjectAPI()
1682 GenStructPackDecl_ObjectAPI(*field.value.type.struct_def, code_ptr, in GenPackUnPack_ObjectAPI()
1704 code += " return Create" + struct_def.name + "(\n"; in GenPackUnPack_ObjectAPI()
1706 for (auto it = struct_def.fields.vec.begin(); in GenPackUnPack_ObjectAPI()
1707 it != struct_def.fields.vec.end(); ++it) { in GenPackUnPack_ObjectAPI()
1713 if (struct_def.fixed) { in GenPackUnPack_ObjectAPI()
1714 GenStructPackCall_ObjectAPI(*field.value.type.struct_def, in GenPackUnPack_ObjectAPI()
1719 if (field.value.type.struct_def->fixed) { in GenPackUnPack_ObjectAPI()
1732 if (field.value.type.struct_def != nullptr) { in GenPackUnPack_ObjectAPI()
1733 GenStructPackCall_ObjectAPI(*field.value.type.struct_def, in GenPackUnPack_ObjectAPI()
1759 code += " Start" + struct_def.name + "(builder);\n"; in GenPackUnPack_ObjectAPI()
1760 for (auto it = struct_def.fields.vec.begin(); in GenPackUnPack_ObjectAPI()
1761 it != struct_def.fields.vec.end(); ++it) { in GenPackUnPack_ObjectAPI()
1767 if (field.value.type.struct_def->fixed) { in GenPackUnPack_ObjectAPI()
1800 code += " return End" + struct_def.name + "(builder);\n"; in GenPackUnPack_ObjectAPI()
1806 const StructDef &struct_def, std::string *code_ptr, in GenStructPackDecl_ObjectAPI() argument
1809 for (auto it = struct_def.fields.vec.begin(); in GenStructPackDecl_ObjectAPI()
1810 it != struct_def.fields.vec.end(); ++it) { in GenStructPackDecl_ObjectAPI()
1820 if (field_type.struct_def != nullptr) { in GenStructPackDecl_ObjectAPI()
1821 GenStructPackDecl_ObjectAPI(*field_type.struct_def, code_ptr, in GenStructPackDecl_ObjectAPI()
1881 void GenStructPackCall_ObjectAPI(const StructDef &struct_def, in GenStructPackCall_ObjectAPI() argument
1885 for (auto it = struct_def.fields.vec.begin(); in GenStructPackCall_ObjectAPI()
1886 it != struct_def.fields.vec.end(); ++it) { in GenStructPackCall_ObjectAPI()
1889 if (field_type.struct_def != nullptr) { in GenStructPackCall_ObjectAPI()
1890 GenStructPackCall_ObjectAPI(*field_type.struct_def, code_ptr, in GenStructPackCall_ObjectAPI()
1907 if (type.struct_def != nullptr) { in GenTypeGet_ObjectAPI()
1908 auto type_name_length = type.struct_def->name.length(); in GenTypeGet_ObjectAPI()
1910 GenTypeName_ObjectAPI(type.struct_def->name, opts); in GenTypeGet_ObjectAPI()
1940 void GenStruct_ObjectAPI(StructDef &struct_def, std::string *code_ptr, in GenStruct_ObjectAPI() argument
1943 if (struct_def.attributes.Lookup("private")) { in GenStruct_ObjectAPI()
1948 if (struct_def.attributes.Lookup("csharp_partial")) { in GenStruct_ObjectAPI()
1952 auto class_name = GenTypeName_ObjectAPI(struct_def.name, opts); in GenStruct_ObjectAPI()
1956 for (auto it = struct_def.fields.vec.begin(); in GenStruct_ObjectAPI()
1957 it != struct_def.fields.vec.end(); ++it) { in GenStruct_ObjectAPI()
2024 for (auto it = struct_def.fields.vec.begin(); in GenStruct_ObjectAPI()
2025 it != struct_def.fields.vec.end(); ++it) { in GenStruct_ObjectAPI()
2059 parser_.root_struct_def_ == &struct_def) { in GenStruct_ObjectAPI()
2072 if (parser_.root_struct_def_ == &struct_def) { in GenStruct_ObjectAPI()
2075 code += " return " + struct_def.name + ".GetRootAs" + struct_def.name + in GenStruct_ObjectAPI()
2080 code += " " + struct_def.name + ".Finish" + struct_def.name + in GenStruct_ObjectAPI()
2081 "Buffer(fbb, " + struct_def.name + ".Pack(fbb, this));\n"; in GenStruct_ObjectAPI()