"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.TupleNotificationT = exports.TupleNotification = void 0;
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
const flatbuffers = require("flatbuffers");
const tuple_1 = require("../../fbs/transport/tuple");
class TupleNotification {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsTupleNotification(bb, obj) {
        return (obj || new TupleNotification()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsTupleNotification(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new TupleNotification()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    tuple(obj) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? (obj || new tuple_1.Tuple()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
    }
    static startTupleNotification(builder) {
        builder.startObject(1);
    }
    static addTuple(builder, tupleOffset) {
        builder.addFieldOffset(0, tupleOffset, 0);
    }
    static endTupleNotification(builder) {
        const offset = builder.endObject();
        builder.requiredField(offset, 4); // tuple
        return offset;
    }
    static createTupleNotification(builder, tupleOffset) {
        TupleNotification.startTupleNotification(builder);
        TupleNotification.addTuple(builder, tupleOffset);
        return TupleNotification.endTupleNotification(builder);
    }
    unpack() {
        return new TupleNotificationT((this.tuple() !== null ? this.tuple().unpack() : null));
    }
    unpackTo(_o) {
        _o.tuple = (this.tuple() !== null ? this.tuple().unpack() : null);
    }
}
exports.TupleNotification = TupleNotification;
class TupleNotificationT {
    tuple;
    constructor(tuple = null) {
        this.tuple = tuple;
    }
    pack(builder) {
        const tuple = (this.tuple !== null ? this.tuple.pack(builder) : 0);
        return TupleNotification.createTupleNotification(builder, tuple);
    }
}
exports.TupleNotificationT = TupleNotificationT;
