mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-12 16:00:59 +00:00
bulk code format fix (#8707)
This commit is contained in:
4
tests/ts/typescript/class.d.ts
vendored
4
tests/ts/typescript/class.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
export declare enum class_ {
|
||||
new_ = 0,
|
||||
instanceof_ = 1
|
||||
new_ = 0,
|
||||
instanceof_ = 1,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any,
|
||||
* @typescript-eslint/no-non-null-assertion */
|
||||
export var class_;
|
||||
(function (class_) {
|
||||
class_[class_["new_"] = 0] = "new_";
|
||||
class_[class_["instanceof_"] = 1] = "instanceof_";
|
||||
(function(class_) {
|
||||
class_[class_['new_'] = 0] = 'new_';
|
||||
class_[class_['instanceof_'] = 1] = 'instanceof_';
|
||||
})(class_ || (class_ = {}));
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
|
||||
export enum class_ {
|
||||
new_ = 0,
|
||||
instanceof_ = 1
|
||||
instanceof_ = 1,
|
||||
}
|
||||
|
||||
104
tests/ts/typescript/object.d.ts
vendored
104
tests/ts/typescript/object.d.ts
vendored
@@ -1,48 +1,64 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { Abc } from '../foobar/abc.js';
|
||||
import { class_ as foobar_class_ } from '../foobar/class.js';
|
||||
import { Schema, SchemaT } from '../reflection/schema.js';
|
||||
import { class_ } from '../typescript/class.js';
|
||||
export declare class Object_ implements flatbuffers.IUnpackableObject<Object_T> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Object_;
|
||||
static getRootAsObject(bb: flatbuffers.ByteBuffer, obj?: Object_): Object_;
|
||||
static getSizePrefixedRootAsObject(bb: flatbuffers.ByteBuffer, obj?: Object_): Object_;
|
||||
return_(): number;
|
||||
mutate_return(value: number): boolean;
|
||||
if_(): number;
|
||||
mutate_if(value: number): boolean;
|
||||
switch_(): number;
|
||||
mutate_switch(value: number): boolean;
|
||||
enum_(): class_;
|
||||
mutate_enum(value: class_): boolean;
|
||||
enum2(): foobar_class_;
|
||||
mutate_enum2(value: foobar_class_): boolean;
|
||||
enum3(): Abc;
|
||||
mutate_enum3(value: Abc): boolean;
|
||||
reflect(obj?: Schema): Schema | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startObject(builder: flatbuffers.Builder): void;
|
||||
static addReturn(builder: flatbuffers.Builder, return_: number): void;
|
||||
static addIf(builder: flatbuffers.Builder, if_: number): void;
|
||||
static addSwitch(builder: flatbuffers.Builder, switch_: number): void;
|
||||
static addEnum(builder: flatbuffers.Builder, enum_: class_): void;
|
||||
static addEnum2(builder: flatbuffers.Builder, enum2: foobar_class_): void;
|
||||
static addEnum3(builder: flatbuffers.Builder, enum3: Abc): void;
|
||||
static addReflect(builder: flatbuffers.Builder, reflectOffset: flatbuffers.Offset): void;
|
||||
static endObject(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
unpack(): Object_T;
|
||||
unpackTo(_o: Object_T): void;
|
||||
import {Abc} from '../foobar/abc.js';
|
||||
import {class_ as foobar_class_} from '../foobar/class.js';
|
||||
import {Schema, SchemaT} from '../reflection/schema.js';
|
||||
import {class_} from '../typescript/class.js';
|
||||
export declare class Object_
|
||||
implements flatbuffers.IUnpackableObject<Object_T>
|
||||
{
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Object_;
|
||||
static getRootAsObject(bb: flatbuffers.ByteBuffer, obj?: Object_): Object_;
|
||||
static getSizePrefixedRootAsObject(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Object_,
|
||||
): Object_;
|
||||
return_(): number;
|
||||
mutate_return(value: number): boolean;
|
||||
if_(): number;
|
||||
mutate_if(value: number): boolean;
|
||||
switch_(): number;
|
||||
mutate_switch(value: number): boolean;
|
||||
enum_(): class_;
|
||||
mutate_enum(value: class_): boolean;
|
||||
enum2(): foobar_class_;
|
||||
mutate_enum2(value: foobar_class_): boolean;
|
||||
enum3(): Abc;
|
||||
mutate_enum3(value: Abc): boolean;
|
||||
reflect(obj?: Schema): Schema | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startObject(builder: flatbuffers.Builder): void;
|
||||
static addReturn(builder: flatbuffers.Builder, return_: number): void;
|
||||
static addIf(builder: flatbuffers.Builder, if_: number): void;
|
||||
static addSwitch(builder: flatbuffers.Builder, switch_: number): void;
|
||||
static addEnum(builder: flatbuffers.Builder, enum_: class_): void;
|
||||
static addEnum2(builder: flatbuffers.Builder, enum2: foobar_class_): void;
|
||||
static addEnum3(builder: flatbuffers.Builder, enum3: Abc): void;
|
||||
static addReflect(
|
||||
builder: flatbuffers.Builder,
|
||||
reflectOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static endObject(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
unpack(): Object_T;
|
||||
unpackTo(_o: Object_T): void;
|
||||
}
|
||||
export declare class Object_T implements flatbuffers.IGeneratedObject {
|
||||
return_: number;
|
||||
if_: number;
|
||||
switch_: number;
|
||||
enum_: class_;
|
||||
enum2: foobar_class_;
|
||||
enum3: Abc;
|
||||
reflect: SchemaT | null;
|
||||
constructor(return_?: number, if_?: number, switch_?: number, enum_?: class_, enum2?: foobar_class_, enum3?: Abc, reflect?: SchemaT | null);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
return_: number;
|
||||
if_: number;
|
||||
switch_: number;
|
||||
enum_: class_;
|
||||
enum2: foobar_class_;
|
||||
enum3: Abc;
|
||||
reflect: SchemaT | null;
|
||||
constructor(
|
||||
return_?: number,
|
||||
if_?: number,
|
||||
switch_?: number,
|
||||
enum_?: class_,
|
||||
enum2?: foobar_class_,
|
||||
enum3?: Abc,
|
||||
reflect?: SchemaT | null,
|
||||
);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,167 +1,181 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any,
|
||||
* @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { Abc } from '../foobar/abc.js';
|
||||
import { class_ as foobar_class_ } from '../foobar/class.js';
|
||||
import { Schema } from '../reflection/schema.js';
|
||||
import { class_ } from '../typescript/class.js';
|
||||
|
||||
import {Abc} from '../foobar/abc.js';
|
||||
import {class_ as foobar_class_} from '../foobar/class.js';
|
||||
import {Schema} from '../reflection/schema.js';
|
||||
import {class_} from '../typescript/class.js';
|
||||
|
||||
export class Object_ {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsObject(bb, obj) {
|
||||
return (obj || new Object_())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsObject(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Object_())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
return_() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_return(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
if_() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_if(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
static getRootAsObject(bb, obj) {
|
||||
return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
switch_() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_switch(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
static getSizePrefixedRootAsObject(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
enum_() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : class_.new_;
|
||||
}
|
||||
mutate_enum(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
return_() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
enum2() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) :
|
||||
foobar_class_.arguments_;
|
||||
}
|
||||
mutate_enum2(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
mutate_return(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
if_() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_if(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
switch_() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_switch(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
enum_() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : class_.new_;
|
||||
}
|
||||
mutate_enum(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
enum2() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : foobar_class_.arguments_;
|
||||
}
|
||||
mutate_enum2(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
enum3() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : Abc.a;
|
||||
}
|
||||
mutate_enum3(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
reflect(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? (obj || new Schema()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'typescript.Object';
|
||||
}
|
||||
static startObject(builder) {
|
||||
builder.startObject(7);
|
||||
}
|
||||
static addReturn(builder, return_) {
|
||||
builder.addFieldInt32(0, return_, 0);
|
||||
}
|
||||
static addIf(builder, if_) {
|
||||
builder.addFieldInt32(1, if_, 0);
|
||||
}
|
||||
static addSwitch(builder, switch_) {
|
||||
builder.addFieldInt32(2, switch_, 0);
|
||||
}
|
||||
static addEnum(builder, enum_) {
|
||||
builder.addFieldInt32(3, enum_, class_.new_);
|
||||
}
|
||||
static addEnum2(builder, enum2) {
|
||||
builder.addFieldInt32(4, enum2, foobar_class_.arguments_);
|
||||
}
|
||||
static addEnum3(builder, enum3) {
|
||||
builder.addFieldInt32(5, enum3, Abc.a);
|
||||
}
|
||||
static addReflect(builder, reflectOffset) {
|
||||
builder.addFieldOffset(6, reflectOffset, 0);
|
||||
}
|
||||
static endObject(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
unpack() {
|
||||
return new Object_T(this.return_(), this.if_(), this.switch_(), this.enum_(), this.enum2(), this.enum3(), (this.reflect() !== null ? this.reflect().unpack() : null));
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.return_ = this.return_();
|
||||
_o.if_ = this.if_();
|
||||
_o.switch_ = this.switch_();
|
||||
_o.enum_ = this.enum_();
|
||||
_o.enum2 = this.enum2();
|
||||
_o.enum3 = this.enum3();
|
||||
_o.reflect = (this.reflect() !== null ? this.reflect().unpack() : null);
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
enum3() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : Abc.a;
|
||||
}
|
||||
mutate_enum3(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
reflect(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ?
|
||||
(obj || new Schema())
|
||||
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
|
||||
null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'typescript.Object';
|
||||
}
|
||||
static startObject(builder) {
|
||||
builder.startObject(7);
|
||||
}
|
||||
static addReturn(builder, return_) {
|
||||
builder.addFieldInt32(0, return_, 0);
|
||||
}
|
||||
static addIf(builder, if_) {
|
||||
builder.addFieldInt32(1, if_, 0);
|
||||
}
|
||||
static addSwitch(builder, switch_) {
|
||||
builder.addFieldInt32(2, switch_, 0);
|
||||
}
|
||||
static addEnum(builder, enum_) {
|
||||
builder.addFieldInt32(3, enum_, class_.new_);
|
||||
}
|
||||
static addEnum2(builder, enum2) {
|
||||
builder.addFieldInt32(4, enum2, foobar_class_.arguments_);
|
||||
}
|
||||
static addEnum3(builder, enum3) {
|
||||
builder.addFieldInt32(5, enum3, Abc.a);
|
||||
}
|
||||
static addReflect(builder, reflectOffset) {
|
||||
builder.addFieldOffset(6, reflectOffset, 0);
|
||||
}
|
||||
static endObject(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
unpack() {
|
||||
return new Object_T(
|
||||
this.return_(), this.if_(), this.switch_(), this.enum_(), this.enum2(),
|
||||
this.enum3(),
|
||||
(this.reflect() !== null ? this.reflect().unpack() : null));
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.return_ = this.return_();
|
||||
_o.if_ = this.if_();
|
||||
_o.switch_ = this.switch_();
|
||||
_o.enum_ = this.enum_();
|
||||
_o.enum2 = this.enum2();
|
||||
_o.enum3 = this.enum3();
|
||||
_o.reflect = (this.reflect() !== null ? this.reflect().unpack() : null);
|
||||
}
|
||||
}
|
||||
export class Object_T {
|
||||
constructor(return_ = 0, if_ = 0, switch_ = 0, enum_ = class_.new_, enum2 = foobar_class_.arguments_, enum3 = Abc.a, reflect = null) {
|
||||
this.return_ = return_;
|
||||
this.if_ = if_;
|
||||
this.switch_ = switch_;
|
||||
this.enum_ = enum_;
|
||||
this.enum2 = enum2;
|
||||
this.enum3 = enum3;
|
||||
this.reflect = reflect;
|
||||
}
|
||||
pack(builder) {
|
||||
const reflect = (this.reflect !== null ? this.reflect.pack(builder) : 0);
|
||||
Object_.startObject(builder);
|
||||
Object_.addReturn(builder, this.return_);
|
||||
Object_.addIf(builder, this.if_);
|
||||
Object_.addSwitch(builder, this.switch_);
|
||||
Object_.addEnum(builder, this.enum_);
|
||||
Object_.addEnum2(builder, this.enum2);
|
||||
Object_.addEnum3(builder, this.enum3);
|
||||
Object_.addReflect(builder, reflect);
|
||||
return Object_.endObject(builder);
|
||||
}
|
||||
constructor(
|
||||
return_ = 0, if_ = 0, switch_ = 0, enum_ = class_.new_,
|
||||
enum2 = foobar_class_.arguments_, enum3 = Abc.a, reflect = null) {
|
||||
this.return_ = return_;
|
||||
this.if_ = if_;
|
||||
this.switch_ = switch_;
|
||||
this.enum_ = enum_;
|
||||
this.enum2 = enum2;
|
||||
this.enum3 = enum3;
|
||||
this.reflect = reflect;
|
||||
}
|
||||
pack(builder) {
|
||||
const reflect = (this.reflect !== null ? this.reflect.pack(builder) : 0);
|
||||
Object_.startObject(builder);
|
||||
Object_.addReturn(builder, this.return_);
|
||||
Object_.addIf(builder, this.if_);
|
||||
Object_.addSwitch(builder, this.switch_);
|
||||
Object_.addEnum(builder, this.enum_);
|
||||
Object_.addEnum2(builder, this.enum2);
|
||||
Object_.addEnum3(builder, this.enum3);
|
||||
Object_.addReflect(builder, reflect);
|
||||
return Object_.endObject(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,221 +4,236 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Abc } from '../foobar/abc.js';
|
||||
import { class_ as foobar_class_ } from '../foobar/class.js';
|
||||
import { Schema, SchemaT } from '../reflection/schema.js';
|
||||
import { class_ } from '../typescript/class.js';
|
||||
|
||||
import {Abc} from '../foobar/abc.js';
|
||||
import {class_ as foobar_class_} from '../foobar/class.js';
|
||||
import {Schema, SchemaT} from '../reflection/schema.js';
|
||||
import {class_} from '../typescript/class.js';
|
||||
|
||||
export class Object_ implements flatbuffers.IUnpackableObject<Object_T> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Object_ {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsObject(bb:flatbuffers.ByteBuffer, obj?:Object_):Object_ {
|
||||
return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsObject(bb:flatbuffers.ByteBuffer, obj?:Object_):Object_ {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
return_():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_return(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Object_ {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
if_():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_if(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
static getRootAsObject(bb: flatbuffers.ByteBuffer, obj?: Object_): Object_ {
|
||||
return (obj || new Object_()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
switch_():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_switch(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
static getSizePrefixedRootAsObject(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Object_,
|
||||
): Object_ {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Object_()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
enum_():class_ {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : class_.new_;
|
||||
}
|
||||
|
||||
mutate_enum(value:class_):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
return_(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
mutate_return(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
enum2():foobar_class_ {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : foobar_class_.arguments_;
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mutate_enum2(value:foobar_class_):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
enum3():Abc {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : Abc.a;
|
||||
}
|
||||
|
||||
mutate_enum3(value:Abc):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
if_(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
mutate_if(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
|
||||
reflect(obj?:Schema):Schema|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset ? (obj || new Schema()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'typescript.Object';
|
||||
}
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static startObject(builder:flatbuffers.Builder) {
|
||||
builder.startObject(7);
|
||||
}
|
||||
switch_(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static addReturn(builder:flatbuffers.Builder, return_:number) {
|
||||
builder.addFieldInt32(0, return_, 0);
|
||||
}
|
||||
mutate_switch(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
|
||||
static addIf(builder:flatbuffers.Builder, if_:number) {
|
||||
builder.addFieldInt32(1, if_, 0);
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static addSwitch(builder:flatbuffers.Builder, switch_:number) {
|
||||
builder.addFieldInt32(2, switch_, 0);
|
||||
}
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static addEnum(builder:flatbuffers.Builder, enum_:class_) {
|
||||
builder.addFieldInt32(3, enum_, class_.new_);
|
||||
}
|
||||
enum_(): class_ {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : class_.new_;
|
||||
}
|
||||
|
||||
static addEnum2(builder:flatbuffers.Builder, enum2:foobar_class_) {
|
||||
builder.addFieldInt32(4, enum2, foobar_class_.arguments_);
|
||||
}
|
||||
mutate_enum(value: class_): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
|
||||
static addEnum3(builder:flatbuffers.Builder, enum3:Abc) {
|
||||
builder.addFieldInt32(5, enum3, Abc.a);
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static addReflect(builder:flatbuffers.Builder, reflectOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(6, reflectOffset, 0);
|
||||
}
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static endObject(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
enum2(): foobar_class_ {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset
|
||||
? this.bb!.readInt32(this.bb_pos + offset)
|
||||
: foobar_class_.arguments_;
|
||||
}
|
||||
|
||||
mutate_enum2(value: foobar_class_): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
|
||||
unpack(): Object_T {
|
||||
return new Object_T(
|
||||
this.return_(),
|
||||
this.if_(),
|
||||
this.switch_(),
|
||||
this.enum_(),
|
||||
this.enum2(),
|
||||
this.enum3(),
|
||||
(this.reflect() !== null ? this.reflect()!.unpack() : null)
|
||||
);
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
unpackTo(_o: Object_T): void {
|
||||
_o.return_ = this.return_();
|
||||
_o.if_ = this.if_();
|
||||
_o.switch_ = this.switch_();
|
||||
_o.enum_ = this.enum_();
|
||||
_o.enum2 = this.enum2();
|
||||
_o.enum3 = this.enum3();
|
||||
_o.reflect = (this.reflect() !== null ? this.reflect()!.unpack() : null);
|
||||
}
|
||||
enum3(): Abc {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : Abc.a;
|
||||
}
|
||||
|
||||
mutate_enum3(value: Abc): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
reflect(obj?: Schema): Schema | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset
|
||||
? (obj || new Schema()).__init(
|
||||
this.bb!.__indirect(this.bb_pos + offset),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'typescript.Object';
|
||||
}
|
||||
|
||||
static startObject(builder: flatbuffers.Builder) {
|
||||
builder.startObject(7);
|
||||
}
|
||||
|
||||
static addReturn(builder: flatbuffers.Builder, return_: number) {
|
||||
builder.addFieldInt32(0, return_, 0);
|
||||
}
|
||||
|
||||
static addIf(builder: flatbuffers.Builder, if_: number) {
|
||||
builder.addFieldInt32(1, if_, 0);
|
||||
}
|
||||
|
||||
static addSwitch(builder: flatbuffers.Builder, switch_: number) {
|
||||
builder.addFieldInt32(2, switch_, 0);
|
||||
}
|
||||
|
||||
static addEnum(builder: flatbuffers.Builder, enum_: class_) {
|
||||
builder.addFieldInt32(3, enum_, class_.new_);
|
||||
}
|
||||
|
||||
static addEnum2(builder: flatbuffers.Builder, enum2: foobar_class_) {
|
||||
builder.addFieldInt32(4, enum2, foobar_class_.arguments_);
|
||||
}
|
||||
|
||||
static addEnum3(builder: flatbuffers.Builder, enum3: Abc) {
|
||||
builder.addFieldInt32(5, enum3, Abc.a);
|
||||
}
|
||||
|
||||
static addReflect(
|
||||
builder: flatbuffers.Builder,
|
||||
reflectOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(6, reflectOffset, 0);
|
||||
}
|
||||
|
||||
static endObject(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
unpack(): Object_T {
|
||||
return new Object_T(
|
||||
this.return_(),
|
||||
this.if_(),
|
||||
this.switch_(),
|
||||
this.enum_(),
|
||||
this.enum2(),
|
||||
this.enum3(),
|
||||
this.reflect() !== null ? this.reflect()!.unpack() : null,
|
||||
);
|
||||
}
|
||||
|
||||
unpackTo(_o: Object_T): void {
|
||||
_o.return_ = this.return_();
|
||||
_o.if_ = this.if_();
|
||||
_o.switch_ = this.switch_();
|
||||
_o.enum_ = this.enum_();
|
||||
_o.enum2 = this.enum2();
|
||||
_o.enum3 = this.enum3();
|
||||
_o.reflect = this.reflect() !== null ? this.reflect()!.unpack() : null;
|
||||
}
|
||||
}
|
||||
|
||||
export class Object_T implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public return_: number = 0,
|
||||
public if_: number = 0,
|
||||
public switch_: number = 0,
|
||||
public enum_: class_ = class_.new_,
|
||||
public enum2: foobar_class_ = foobar_class_.arguments_,
|
||||
public enum3: Abc = Abc.a,
|
||||
public reflect: SchemaT|null = null
|
||||
){}
|
||||
constructor(
|
||||
public return_: number = 0,
|
||||
public if_: number = 0,
|
||||
public switch_: number = 0,
|
||||
public enum_: class_ = class_.new_,
|
||||
public enum2: foobar_class_ = foobar_class_.arguments_,
|
||||
public enum3: Abc = Abc.a,
|
||||
public reflect: SchemaT | null = null,
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const reflect = this.reflect !== null ? this.reflect!.pack(builder) : 0;
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const reflect = (this.reflect !== null ? this.reflect!.pack(builder) : 0);
|
||||
Object_.startObject(builder);
|
||||
Object_.addReturn(builder, this.return_);
|
||||
Object_.addIf(builder, this.if_);
|
||||
Object_.addSwitch(builder, this.switch_);
|
||||
Object_.addEnum(builder, this.enum_);
|
||||
Object_.addEnum2(builder, this.enum2);
|
||||
Object_.addEnum3(builder, this.enum3);
|
||||
Object_.addReflect(builder, reflect);
|
||||
|
||||
Object_.startObject(builder);
|
||||
Object_.addReturn(builder, this.return_);
|
||||
Object_.addIf(builder, this.if_);
|
||||
Object_.addSwitch(builder, this.switch_);
|
||||
Object_.addEnum(builder, this.enum_);
|
||||
Object_.addEnum2(builder, this.enum2);
|
||||
Object_.addEnum3(builder, this.enum3);
|
||||
Object_.addReflect(builder, reflect);
|
||||
|
||||
return Object_.endObject(builder);
|
||||
}
|
||||
return Object_.endObject(builder);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user