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