mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-21 09:35:45 +00:00
Cleaned up namespace handling.
A Namespace object is now guaranteed unique. This cleaned up some old workarounds and latent bugs. Change-Id: Ic3f12d89947871b03b2c449ba51b3186f953adde Tested: on Linux. Bug: 21336857
This commit is contained in:
@@ -43,6 +43,57 @@ MyGame.Example.Any = {
|
||||
MyGame_Example2_Monster: 3
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
MyGame.InParentNamespace = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {MyGame.InParentNamespace}
|
||||
*/
|
||||
MyGame.InParentNamespace.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {MyGame.InParentNamespace=} obj
|
||||
* @returns {MyGame.InParentNamespace}
|
||||
*/
|
||||
MyGame.InParentNamespace.getRootAsInParentNamespace = function(bb, obj) {
|
||||
return (obj || new MyGame.InParentNamespace).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
MyGame.InParentNamespace.startInParentNamespace = function(builder) {
|
||||
builder.startObject(0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
MyGame.InParentNamespace.endInParentNamespace = function(builder) {
|
||||
var offset = builder.endObject();
|
||||
return offset;
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
@@ -1356,11 +1407,20 @@ MyGame.Example.Monster.prototype.vectorOfDoublesArray = function() {
|
||||
return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {MyGame.InParentNamespace=} obj
|
||||
* @returns {MyGame.InParentNamespace|null}
|
||||
*/
|
||||
MyGame.Example.Monster.prototype.parentNamespaceTest = function(obj) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 72);
|
||||
return offset ? (obj || new MyGame.InParentNamespace).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
MyGame.Example.Monster.startMonster = function(builder) {
|
||||
builder.startObject(34);
|
||||
builder.startObject(35);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1840,6 +1900,14 @@ MyGame.Example.Monster.startVectorOfDoublesVector = function(builder, numElems)
|
||||
builder.startVector(8, numElems, 8);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} parentNamespaceTestOffset
|
||||
*/
|
||||
MyGame.Example.Monster.addParentNamespaceTest = function(builder, parentNamespaceTestOffset) {
|
||||
builder.addFieldOffset(34, parentNamespaceTestOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
|
||||
Reference in New Issue
Block a user