1============== OrderWithIds.fbs ============ 2include "${DIR}/tracing_schema_common.fbs"; 3 4table OrderWithIds (tag: "ORDI") { 5 fieldz: int (id: 1); 6 fieldy: int (id: 2); 7 fieldx: int (id: 0); 8} 9============== diagnosis ============ 10 11============== result ============ 12// Autogenerated by tracing_traits_generator, do not edit 13 14#ifndef THIRD_PARTY_FCP_TRACING_TOOLS_TESTDATA_ORDERWITHIDS_H 15#define THIRD_PARTY_FCP_TRACING_TOOLS_TESTDATA_ORDERWITHIDS_H 16 17#ifdef FLATBUFFERS_GENERATED_TRACINGSCHEMA_H_ 18#undef FLATBUFFERS_GENERATED_TRACINGSCHEMA_H_ 19#endif 20#include "${DIR}/tools/testdata/OrderWithIds_generated.h" 21#include "absl/strings/string_view.h" 22#include "${DIR}/tracing_severity.h" 23#include "${DIR}/tracing_traits.h" 24#include "flatbuffers/minireflect.h" 25#include "flatbuffers/idl.h" 26#include "${BASE}/platform.h" 27 28namespace fcp { 29 30template<> class TracingTraits<OrderWithIds>: public TracingTraitsBase { 31 public: 32 static constexpr TracingTag kTag = TracingTag("ORDI"); 33 static constexpr TracingSeverity kSeverity = fcp::TracingSeverity::kInfo; 34 static constexpr bool kIsSpan = false; 35 const char* Name() const override { return "OrderWithIds"; } 36 TracingSeverity Severity() const override { 37 return fcp::TracingSeverity::kInfo; 38 } 39 std::string TextFormat(const flatbuffers::DetachedBuffer& buf) const override { 40 return flatbuffers::FlatBufferToString(buf.data(), OrderWithIdsTypeTable()); 41 } 42 std::string JsonStringFormat(const uint8_t* flatbuf_bytes) const override { 43 flatbuffers::Parser parser; 44 std::string schema_file; 45 std::string fbs_file = "${RUNFILE_PATH}/tools/testdata/OrderWithIds.fbs"; 46 flatbuffers::LoadFile(GetDataPath(fbs_file).c_str(), true, &schema_file); 47 std::string schema_path_common = GetDataPath("${DIR}/tracing_schema_common.fbs"); 48 std::string directory_common = schema_path_common.substr(0, schema_path_common.find("${DIR}/tracing_schema_common.fbs")); 49 const char *include_directories[] = { 50 directory_common.c_str(), nullptr}; 51 parser.Parse(schema_file.c_str(), include_directories); 52 std::string jsongen; 53 parser.SetRootType("OrderWithIds"); 54 GenerateText(parser, flatbuf_bytes, &jsongen); 55 return jsongen; 56 } 57 static flatbuffers::Offset<OrderWithIds> Create(std::int32_t fieldx, std::int32_t fieldz, std::int32_t fieldy, flatbuffers::FlatBufferBuilder* fbb) { 58 return CreateOrderWithIds(*fbb, fieldx, fieldz, fieldy); 59 } 60 using TupleType = std::tuple<std::int32_t, std::int32_t, std::int32_t>; 61 static TupleType MakeTuple(const OrderWithIds* table) { 62 return std::make_tuple(table->fieldx(), table->fieldz(), table->fieldy()); 63 } 64}; 65static internal::TracingTraitsRegistrar<OrderWithIds> registrar_OrderWithIds; 66} // namespace fcp 67 68#endif // THIRD_PARTY_FCP_TRACING_TOOLS_TESTDATA_ORDERWITHIDS_H 69 70