nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

commit a1acd807aa7abbe4aabdeffc895c0a5f1481e29d
parent 1f614f07e17fd9c0c23b97d9b0eefacefdbd3f9c
Author: William Casarin <jb55@jb55.com>
Date:   Sat,  7 Oct 2023 22:43:05 -0700

update generated bindings for note metadata

Diffstat:
Mbindings/c/meta_builder.h | 27++++++++++++++++++++++-----
Mbindings/c/meta_json_parser.h | 160++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
Mbindings/c/meta_reader.h | 5+++++
Mbindings/c/meta_verifier.h | 5+++++
Mbindings/rust/ndb_meta.rs | 85+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abindings/swift/NdbMeta.swift | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 335 insertions(+), 18 deletions(-)

diff --git a/bindings/c/meta_builder.h b/bindings/c/meta_builder.h @@ -20,19 +20,31 @@ static const flatbuffers_voffset_t __NdbEventMeta_required[] = { 0 }; typedef flatbuffers_ref_t NdbEventMeta_ref_t; static NdbEventMeta_ref_t NdbEventMeta_clone(flatbuffers_builder_t *B, NdbEventMeta_table_t t); -__flatbuffers_build_table(flatbuffers_, NdbEventMeta, 1) +__flatbuffers_build_table(flatbuffers_, NdbEventMeta, 6) -#define __NdbEventMeta_formal_args , int32_t v0 -#define __NdbEventMeta_call_args , v0 +#define __NdbEventMeta_formal_args ,\ + int32_t v0, int32_t v1, int32_t v2, int32_t v3, int32_t v4, int64_t v5 +#define __NdbEventMeta_call_args ,\ + v0, v1, v2, v3, v4, v5 static inline NdbEventMeta_ref_t NdbEventMeta_create(flatbuffers_builder_t *B __NdbEventMeta_formal_args); __flatbuffers_build_table_prolog(flatbuffers_, NdbEventMeta, NdbEventMeta_file_identifier, NdbEventMeta_type_identifier) __flatbuffers_build_scalar_field(0, flatbuffers_, NdbEventMeta_received_at, flatbuffers_int32, int32_t, 4, 4, INT32_C(0), NdbEventMeta) +__flatbuffers_build_scalar_field(1, flatbuffers_, NdbEventMeta_reactions, flatbuffers_int32, int32_t, 4, 4, INT32_C(0), NdbEventMeta) +__flatbuffers_build_scalar_field(2, flatbuffers_, NdbEventMeta_quotes, flatbuffers_int32, int32_t, 4, 4, INT32_C(0), NdbEventMeta) +__flatbuffers_build_scalar_field(3, flatbuffers_, NdbEventMeta_reposts, flatbuffers_int32, int32_t, 4, 4, INT32_C(0), NdbEventMeta) +__flatbuffers_build_scalar_field(4, flatbuffers_, NdbEventMeta_zaps, flatbuffers_int32, int32_t, 4, 4, INT32_C(0), NdbEventMeta) +__flatbuffers_build_scalar_field(5, flatbuffers_, NdbEventMeta_zap_total, flatbuffers_int64, int64_t, 8, 8, INT64_C(0), NdbEventMeta) static inline NdbEventMeta_ref_t NdbEventMeta_create(flatbuffers_builder_t *B __NdbEventMeta_formal_args) { if (NdbEventMeta_start(B) - || NdbEventMeta_received_at_add(B, v0)) { + || NdbEventMeta_zap_total_add(B, v5) + || NdbEventMeta_received_at_add(B, v0) + || NdbEventMeta_reactions_add(B, v1) + || NdbEventMeta_quotes_add(B, v2) + || NdbEventMeta_reposts_add(B, v3) + || NdbEventMeta_zaps_add(B, v4)) { return 0; } return NdbEventMeta_end(B); @@ -42,7 +54,12 @@ static NdbEventMeta_ref_t NdbEventMeta_clone(flatbuffers_builder_t *B, NdbEventM { __flatbuffers_memoize_begin(B, t); if (NdbEventMeta_start(B) - || NdbEventMeta_received_at_pick(B, t)) { + || NdbEventMeta_zap_total_pick(B, t) + || NdbEventMeta_received_at_pick(B, t) + || NdbEventMeta_reactions_pick(B, t) + || NdbEventMeta_quotes_pick(B, t) + || NdbEventMeta_reposts_pick(B, t) + || NdbEventMeta_zaps_pick(B, t)) { return 0; } __flatbuffers_memoize_end(B, t, NdbEventMeta_end(B)); diff --git a/bindings/c/meta_json_parser.h b/bindings/c/meta_json_parser.h @@ -33,16 +33,14 @@ static const char *NdbEventMeta_parse_json_table(flatcc_json_parser_t *ctx, cons uint64_t w; *result = 0; - if (flatcc_builder_start_table(ctx->ctx, 1)) goto failed; + if (flatcc_builder_start_table(ctx->ctx, 6)) goto failed; buf = flatcc_json_parser_object_start(ctx, buf, end, &more); while (more) { buf = flatcc_json_parser_symbol_start(ctx, buf, end); w = flatcc_json_parser_symbol_part(buf, end); - if (w == 0x7265636569766564) { /* descend "received" */ - buf += 8; - w = flatcc_json_parser_symbol_part(buf, end); - if ((w & 0xffffff0000000000) == 0x5f61740000000000) { /* "_at" */ - buf = flatcc_json_parser_match_symbol(ctx, (mark = buf), end, 3); + if (w < 0x7265636569766564) { /* branch "received" */ + if ((w & 0xffffffffffff0000) == 0x71756f7465730000) { /* "quotes" */ + buf = flatcc_json_parser_match_symbol(ctx, (mark = buf), end, 6); if (mark != buf) { int32_t val = 0; static flatcc_json_parser_integral_symbol_f *symbolic_parsers[] = { @@ -54,18 +52,154 @@ static const char *NdbEventMeta_parse_json_table(flatcc_json_parser_t *ctx, cons if (buf == mark || buf == end) goto failed; } if (val != INT32_C(0) || (ctx->flags & flatcc_json_parser_f_force_add)) { - if (!(pval = flatcc_builder_table_add(ctx->ctx, 0, 4, 4))) goto failed; + if (!(pval = flatcc_builder_table_add(ctx->ctx, 2, 4, 4))) goto failed; flatbuffers_int32_write_to_pe(pval, val); } } else { - buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + goto pfguard1; } - } else { /* "_at" */ + } else { /* "quotes" */ + goto pfguard1; + } /* "quotes" */ + goto endpfguard1; +pfguard1: + if (w == 0x7265616374696f6e) { /* descend "reaction" */ + buf += 8; + w = flatcc_json_parser_symbol_part(buf, end); + if ((w & 0xff00000000000000) == 0x7300000000000000) { /* "s" */ + buf = flatcc_json_parser_match_symbol(ctx, (mark = buf), end, 1); + if (mark != buf) { + int32_t val = 0; + static flatcc_json_parser_integral_symbol_f *symbolic_parsers[] = { + meta_local_json_parser_enum, + meta_global_json_parser_enum, 0 }; + buf = flatcc_json_parser_int32(ctx, (mark = buf), end, &val); + if (mark == buf) { + buf = flatcc_json_parser_symbolic_int32(ctx, (mark = buf), end, symbolic_parsers, &val); + if (buf == mark || buf == end) goto failed; + } + if (val != INT32_C(0) || (ctx->flags & flatcc_json_parser_f_force_add)) { + if (!(pval = flatcc_builder_table_add(ctx->ctx, 1, 4, 4))) goto failed; + flatbuffers_int32_write_to_pe(pval, val); + } + } else { + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } + } else { /* "s" */ + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } /* "s" */ + } else { /* descend "reaction" */ buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); - } /* "_at" */ - } else { /* descend "received" */ - buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); - } /* descend "received" */ + } /* descend "reaction" */ +endpfguard1: + (void)0; + } else { /* branch "received" */ + if (w < 0x7265706f73747300) { /* branch "reposts" */ + if (w == 0x7265636569766564) { /* descend "received" */ + buf += 8; + w = flatcc_json_parser_symbol_part(buf, end); + if ((w & 0xffffff0000000000) == 0x5f61740000000000) { /* "_at" */ + buf = flatcc_json_parser_match_symbol(ctx, (mark = buf), end, 3); + if (mark != buf) { + int32_t val = 0; + static flatcc_json_parser_integral_symbol_f *symbolic_parsers[] = { + meta_local_json_parser_enum, + meta_global_json_parser_enum, 0 }; + buf = flatcc_json_parser_int32(ctx, (mark = buf), end, &val); + if (mark == buf) { + buf = flatcc_json_parser_symbolic_int32(ctx, (mark = buf), end, symbolic_parsers, &val); + if (buf == mark || buf == end) goto failed; + } + if (val != INT32_C(0) || (ctx->flags & flatcc_json_parser_f_force_add)) { + if (!(pval = flatcc_builder_table_add(ctx->ctx, 0, 4, 4))) goto failed; + flatbuffers_int32_write_to_pe(pval, val); + } + } else { + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } + } else { /* "_at" */ + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } /* "_at" */ + } else { /* descend "received" */ + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } /* descend "received" */ + } else { /* branch "reposts" */ + if (w < 0x7a61705f746f7461) { /* branch "zap_tota" */ + if ((w & 0xffffffffffffff00) == 0x7265706f73747300) { /* "reposts" */ + buf = flatcc_json_parser_match_symbol(ctx, (mark = buf), end, 7); + if (mark != buf) { + int32_t val = 0; + static flatcc_json_parser_integral_symbol_f *symbolic_parsers[] = { + meta_local_json_parser_enum, + meta_global_json_parser_enum, 0 }; + buf = flatcc_json_parser_int32(ctx, (mark = buf), end, &val); + if (mark == buf) { + buf = flatcc_json_parser_symbolic_int32(ctx, (mark = buf), end, symbolic_parsers, &val); + if (buf == mark || buf == end) goto failed; + } + if (val != INT32_C(0) || (ctx->flags & flatcc_json_parser_f_force_add)) { + if (!(pval = flatcc_builder_table_add(ctx->ctx, 3, 4, 4))) goto failed; + flatbuffers_int32_write_to_pe(pval, val); + } + } else { + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } + } else { /* "reposts" */ + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } /* "reposts" */ + } else { /* branch "zap_tota" */ + if (w == 0x7a61705f746f7461) { /* descend "zap_tota" */ + buf += 8; + w = flatcc_json_parser_symbol_part(buf, end); + if ((w & 0xff00000000000000) == 0x6c00000000000000) { /* "l" */ + buf = flatcc_json_parser_match_symbol(ctx, (mark = buf), end, 1); + if (mark != buf) { + int64_t val = 0; + static flatcc_json_parser_integral_symbol_f *symbolic_parsers[] = { + meta_local_json_parser_enum, + meta_global_json_parser_enum, 0 }; + buf = flatcc_json_parser_int64(ctx, (mark = buf), end, &val); + if (mark == buf) { + buf = flatcc_json_parser_symbolic_int64(ctx, (mark = buf), end, symbolic_parsers, &val); + if (buf == mark || buf == end) goto failed; + } + if (val != INT64_C(0) || (ctx->flags & flatcc_json_parser_f_force_add)) { + if (!(pval = flatcc_builder_table_add(ctx->ctx, 5, 8, 8))) goto failed; + flatbuffers_int64_write_to_pe(pval, val); + } + } else { + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } + } else { /* "l" */ + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } /* "l" */ + } else { /* descend "zap_tota" */ + if ((w & 0xffffffff00000000) == 0x7a61707300000000) { /* "zaps" */ + buf = flatcc_json_parser_match_symbol(ctx, (mark = buf), end, 4); + if (mark != buf) { + int32_t val = 0; + static flatcc_json_parser_integral_symbol_f *symbolic_parsers[] = { + meta_local_json_parser_enum, + meta_global_json_parser_enum, 0 }; + buf = flatcc_json_parser_int32(ctx, (mark = buf), end, &val); + if (mark == buf) { + buf = flatcc_json_parser_symbolic_int32(ctx, (mark = buf), end, symbolic_parsers, &val); + if (buf == mark || buf == end) goto failed; + } + if (val != INT32_C(0) || (ctx->flags & flatcc_json_parser_f_force_add)) { + if (!(pval = flatcc_builder_table_add(ctx->ctx, 4, 4, 4))) goto failed; + flatbuffers_int32_write_to_pe(pval, val); + } + } else { + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } + } else { /* "zaps" */ + buf = flatcc_json_parser_unmatched_symbol(ctx, buf, end); + } /* "zaps" */ + } /* descend "zap_tota" */ + } /* branch "zap_tota" */ + } /* branch "reposts" */ + } /* branch "received" */ buf = flatcc_json_parser_object_end(ctx, buf, end, &more); } if (ctx->error) goto failed; diff --git a/bindings/c/meta_reader.h b/bindings/c/meta_reader.h @@ -47,6 +47,11 @@ __flatbuffers_offset_vec_at(NdbEventMeta_table_t, vec, i, 0) __flatbuffers_table_as_root(NdbEventMeta) __flatbuffers_define_scalar_field(0, NdbEventMeta, received_at, flatbuffers_int32, int32_t, INT32_C(0)) +__flatbuffers_define_scalar_field(1, NdbEventMeta, reactions, flatbuffers_int32, int32_t, INT32_C(0)) +__flatbuffers_define_scalar_field(2, NdbEventMeta, quotes, flatbuffers_int32, int32_t, INT32_C(0)) +__flatbuffers_define_scalar_field(3, NdbEventMeta, reposts, flatbuffers_int32, int32_t, INT32_C(0)) +__flatbuffers_define_scalar_field(4, NdbEventMeta, zaps, flatbuffers_int32, int32_t, INT32_C(0)) +__flatbuffers_define_scalar_field(5, NdbEventMeta, zap_total, flatbuffers_int64, int64_t, INT64_C(0)) #include "flatcc/flatcc_epilogue.h" diff --git a/bindings/c/meta_verifier.h b/bindings/c/meta_verifier.h @@ -15,6 +15,11 @@ static int NdbEventMeta_verify_table(flatcc_table_verifier_descriptor_t *td) { int ret; if ((ret = flatcc_verify_field(td, 0, 4, 4) /* received_at */)) return ret; + if ((ret = flatcc_verify_field(td, 1, 4, 4) /* reactions */)) return ret; + if ((ret = flatcc_verify_field(td, 2, 4, 4) /* quotes */)) return ret; + if ((ret = flatcc_verify_field(td, 3, 4, 4) /* reposts */)) return ret; + if ((ret = flatcc_verify_field(td, 4, 4, 4) /* zaps */)) return ret; + if ((ret = flatcc_verify_field(td, 5, 8, 8) /* zap_total */)) return ret; return flatcc_verify_ok; } diff --git a/bindings/rust/ndb_meta.rs b/bindings/rust/ndb_meta.rs @@ -26,6 +26,11 @@ impl<'a> flatbuffers::Follow<'a> for NdbEventMeta<'a> { impl<'a> NdbEventMeta<'a> { pub const VT_RECEIVED_AT: flatbuffers::VOffsetT = 4; + pub const VT_REACTIONS: flatbuffers::VOffsetT = 6; + pub const VT_QUOTES: flatbuffers::VOffsetT = 8; + pub const VT_REPOSTS: flatbuffers::VOffsetT = 10; + pub const VT_ZAPS: flatbuffers::VOffsetT = 12; + pub const VT_ZAP_TOTAL: flatbuffers::VOffsetT = 14; #[inline] pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { @@ -37,6 +42,11 @@ impl<'a> NdbEventMeta<'a> { args: &'args NdbEventMetaArgs ) -> flatbuffers::WIPOffset<NdbEventMeta<'bldr>> { let mut builder = NdbEventMetaBuilder::new(_fbb); + builder.add_zap_total(args.zap_total); + builder.add_zaps(args.zaps); + builder.add_reposts(args.reposts); + builder.add_quotes(args.quotes); + builder.add_reactions(args.reactions); builder.add_received_at(args.received_at); builder.finish() } @@ -49,6 +59,41 @@ impl<'a> NdbEventMeta<'a> { // which contains a valid value in this slot unsafe { self._tab.get::<i32>(NdbEventMeta::VT_RECEIVED_AT, Some(0)).unwrap()} } + #[inline] + pub fn reactions(&self) -> i32 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::<i32>(NdbEventMeta::VT_REACTIONS, Some(0)).unwrap()} + } + #[inline] + pub fn quotes(&self) -> i32 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::<i32>(NdbEventMeta::VT_QUOTES, Some(0)).unwrap()} + } + #[inline] + pub fn reposts(&self) -> i32 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::<i32>(NdbEventMeta::VT_REPOSTS, Some(0)).unwrap()} + } + #[inline] + pub fn zaps(&self) -> i32 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::<i32>(NdbEventMeta::VT_ZAPS, Some(0)).unwrap()} + } + #[inline] + pub fn zap_total(&self) -> i64 { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::<i64>(NdbEventMeta::VT_ZAP_TOTAL, Some(0)).unwrap()} + } } impl flatbuffers::Verifiable for NdbEventMeta<'_> { @@ -59,18 +104,33 @@ impl flatbuffers::Verifiable for NdbEventMeta<'_> { use self::flatbuffers::Verifiable; v.visit_table(pos)? .visit_field::<i32>("received_at", Self::VT_RECEIVED_AT, false)? + .visit_field::<i32>("reactions", Self::VT_REACTIONS, false)? + .visit_field::<i32>("quotes", Self::VT_QUOTES, false)? + .visit_field::<i32>("reposts", Self::VT_REPOSTS, false)? + .visit_field::<i32>("zaps", Self::VT_ZAPS, false)? + .visit_field::<i64>("zap_total", Self::VT_ZAP_TOTAL, false)? .finish(); Ok(()) } } pub struct NdbEventMetaArgs { pub received_at: i32, + pub reactions: i32, + pub quotes: i32, + pub reposts: i32, + pub zaps: i32, + pub zap_total: i64, } impl<'a> Default for NdbEventMetaArgs { #[inline] fn default() -> Self { NdbEventMetaArgs { received_at: 0, + reactions: 0, + quotes: 0, + reposts: 0, + zaps: 0, + zap_total: 0, } } } @@ -85,6 +145,26 @@ impl<'a: 'b, 'b> NdbEventMetaBuilder<'a, 'b> { self.fbb_.push_slot::<i32>(NdbEventMeta::VT_RECEIVED_AT, received_at, 0); } #[inline] + pub fn add_reactions(&mut self, reactions: i32) { + self.fbb_.push_slot::<i32>(NdbEventMeta::VT_REACTIONS, reactions, 0); + } + #[inline] + pub fn add_quotes(&mut self, quotes: i32) { + self.fbb_.push_slot::<i32>(NdbEventMeta::VT_QUOTES, quotes, 0); + } + #[inline] + pub fn add_reposts(&mut self, reposts: i32) { + self.fbb_.push_slot::<i32>(NdbEventMeta::VT_REPOSTS, reposts, 0); + } + #[inline] + pub fn add_zaps(&mut self, zaps: i32) { + self.fbb_.push_slot::<i32>(NdbEventMeta::VT_ZAPS, zaps, 0); + } + #[inline] + pub fn add_zap_total(&mut self, zap_total: i64) { + self.fbb_.push_slot::<i64>(NdbEventMeta::VT_ZAP_TOTAL, zap_total, 0); + } + #[inline] pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> NdbEventMetaBuilder<'a, 'b> { let start = _fbb.start_table(); NdbEventMetaBuilder { @@ -103,6 +183,11 @@ impl core::fmt::Debug for NdbEventMeta<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { let mut ds = f.debug_struct("NdbEventMeta"); ds.field("received_at", &self.received_at()); + ds.field("reactions", &self.reactions()); + ds.field("quotes", &self.quotes()); + ds.field("reposts", &self.reposts()); + ds.field("zaps", &self.zaps()); + ds.field("zap_total", &self.zap_total()); ds.finish() } } diff --git a/bindings/swift/NdbMeta.swift b/bindings/swift/NdbMeta.swift @@ -0,0 +1,71 @@ +// automatically generated by the FlatBuffers compiler, do not modify +// swiftlint:disable all +// swiftformat:disable all + +import FlatBuffers + +public struct NdbEventMeta: FlatBufferObject, Verifiable { + + static func validateVersion() { FlatBuffersVersion_23_5_26() } + public var __buffer: ByteBuffer! { return _accessor.bb } + private var _accessor: Table + + private init(_ t: Table) { _accessor = t } + public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } + + private enum VTOFFSET: VOffset { + case receivedAt = 4 + case reactions = 6 + case quotes = 8 + case reposts = 10 + case zaps = 12 + case zapTotal = 14 + var v: Int32 { Int32(self.rawValue) } + var p: VOffset { self.rawValue } + } + + public var receivedAt: Int32 { let o = _accessor.offset(VTOFFSET.receivedAt.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int32.self, at: o) } + public var reactions: Int32 { let o = _accessor.offset(VTOFFSET.reactions.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int32.self, at: o) } + public var quotes: Int32 { let o = _accessor.offset(VTOFFSET.quotes.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int32.self, at: o) } + public var reposts: Int32 { let o = _accessor.offset(VTOFFSET.reposts.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int32.self, at: o) } + public var zaps: Int32 { let o = _accessor.offset(VTOFFSET.zaps.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int32.self, at: o) } + public var zapTotal: Int64 { let o = _accessor.offset(VTOFFSET.zapTotal.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int64.self, at: o) } + public static func startNdbEventMeta(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 6) } + public static func add(receivedAt: Int32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: receivedAt, def: 0, at: VTOFFSET.receivedAt.p) } + public static func add(reactions: Int32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: reactions, def: 0, at: VTOFFSET.reactions.p) } + public static func add(quotes: Int32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: quotes, def: 0, at: VTOFFSET.quotes.p) } + public static func add(reposts: Int32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: reposts, def: 0, at: VTOFFSET.reposts.p) } + public static func add(zaps: Int32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: zaps, def: 0, at: VTOFFSET.zaps.p) } + public static func add(zapTotal: Int64, _ fbb: inout FlatBufferBuilder) { fbb.add(element: zapTotal, def: 0, at: VTOFFSET.zapTotal.p) } + public static func endNdbEventMeta(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); return end } + public static func createNdbEventMeta( + _ fbb: inout FlatBufferBuilder, + receivedAt: Int32 = 0, + reactions: Int32 = 0, + quotes: Int32 = 0, + reposts: Int32 = 0, + zaps: Int32 = 0, + zapTotal: Int64 = 0 + ) -> Offset { + let __start = NdbEventMeta.startNdbEventMeta(&fbb) + NdbEventMeta.add(receivedAt: receivedAt, &fbb) + NdbEventMeta.add(reactions: reactions, &fbb) + NdbEventMeta.add(quotes: quotes, &fbb) + NdbEventMeta.add(reposts: reposts, &fbb) + NdbEventMeta.add(zaps: zaps, &fbb) + NdbEventMeta.add(zapTotal: zapTotal, &fbb) + return NdbEventMeta.endNdbEventMeta(&fbb, start: __start) + } + + public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable { + var _v = try verifier.visitTable(at: position) + try _v.visit(field: VTOFFSET.receivedAt.p, fieldName: "receivedAt", required: false, type: Int32.self) + try _v.visit(field: VTOFFSET.reactions.p, fieldName: "reactions", required: false, type: Int32.self) + try _v.visit(field: VTOFFSET.quotes.p, fieldName: "quotes", required: false, type: Int32.self) + try _v.visit(field: VTOFFSET.reposts.p, fieldName: "reposts", required: false, type: Int32.self) + try _v.visit(field: VTOFFSET.zaps.p, fieldName: "zaps", required: false, type: Int32.self) + try _v.visit(field: VTOFFSET.zapTotal.p, fieldName: "zapTotal", required: false, type: Int64.self) + _v.finish() + } +} +