當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Builder.EndObject方法代碼示例

本文整理匯總了Golang中github.com/google/flatbuffers/go.Builder.EndObject方法的典型用法代碼示例。如果您正苦於以下問題:Golang Builder.EndObject方法的具體用法?Golang Builder.EndObject怎麽用?Golang Builder.EndObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/google/flatbuffers/go.Builder的用法示例。


在下文中一共展示了Builder.EndObject方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: MonsterEnd

func MonsterEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() }
開發者ID:BlueBrain,項目名稱:flatbuffers,代碼行數:1,代碼來源:Monster.go

示例2: StatEnd

func StatEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() }
開發者ID:mystal,項目名稱:flatbuffers,代碼行數:1,代碼來源:Stat.go

示例3: TableInNestedNSEnd

func TableInNestedNSEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() }
開發者ID:CadeLaRen,項目名稱:flatbuffers,代碼行數:1,代碼來源:TableInNestedNS.go

示例4: PostingEnd

func PostingEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() }
開發者ID:cayleydb,項目名稱:dgraph,代碼行數:1,代碼來源:Posting.go

示例5: FlatBufferColorGroupEnd

func FlatBufferColorGroupEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
開發者ID:jameswei,項目名稱:gosercomp,代碼行數:3,代碼來源:FlatBufferColorGroup.go

示例6: CheckByteLayout


//.........這裏部分代碼省略.........
	// test 6: CreateString

	b = flatbuffers.NewBuilder(0)
	b.CreateString("foo")
	check([]byte{3, 0, 0, 0, 'f', 'o', 'o', 0}) // 0-terminated, no pad
	b.CreateString("moop")
	check([]byte{4, 0, 0, 0, 'm', 'o', 'o', 'p', 0, 0, 0, 0, // 0-terminated, 3-byte pad
		3, 0, 0, 0, 'f', 'o', 'o', 0})

	// test 6b: CreateString unicode

	b = flatbuffers.NewBuilder(0)
	// These characters are chinese from blog.golang.org/strings
	// We use escape codes here so that editors without unicode support
	// aren't bothered:
	uni_str := "\u65e5\u672c\u8a9e"
	b.CreateString(uni_str)
	check([]byte{9, 0, 0, 0, 230, 151, 165, 230, 156, 172, 232, 170, 158, 0, //  null-terminated, 2-byte pad
		0, 0})

	// test 6c: CreateByteString

	b = flatbuffers.NewBuilder(0)
	b.CreateByteString([]byte("foo"))
	check([]byte{3, 0, 0, 0, 'f', 'o', 'o', 0}) // 0-terminated, no pad
	b.CreateByteString([]byte("moop"))
	check([]byte{4, 0, 0, 0, 'm', 'o', 'o', 'p', 0, 0, 0, 0, // 0-terminated, 3-byte pad
		3, 0, 0, 0, 'f', 'o', 'o', 0})

	// test 7: empty vtable
	b = flatbuffers.NewBuilder(0)
	b.StartObject(0)
	check([]byte{})
	b.EndObject()
	check([]byte{4, 0, 4, 0, 4, 0, 0, 0})

	// test 8: vtable with one true bool
	b = flatbuffers.NewBuilder(0)
	check([]byte{})
	b.StartObject(1)
	check([]byte{})
	b.PrependBoolSlot(0, true, false)
	b.EndObject()
	check([]byte{
		6, 0, // vtable bytes
		8, 0, // length of object including vtable offset
		7, 0, // start of bool value
		6, 0, 0, 0, // offset for start of vtable (int32)
		0, 0, 0, // padded to 4 bytes
		1, // bool value
	})

	// test 9: vtable with one default bool
	b = flatbuffers.NewBuilder(0)
	check([]byte{})
	b.StartObject(1)
	check([]byte{})
	b.PrependBoolSlot(0, false, false)
	b.EndObject()
	check([]byte{
		6, 0, // vtable bytes
		4, 0, // end of object from here
		0, 0, // entry 1 is zero
		6, 0, 0, 0, // offset for start of vtable (int32)
	})
開發者ID:bunnyblue,項目名稱:flatbuffers,代碼行數:66,代碼來源:go_test.go

示例7: TestSimpleTableWithEnumEnd

func TestSimpleTableWithEnumEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
開發者ID:google,項目名稱:flatbuffers,代碼行數:3,代碼來源:TestSimpleTableWithEnum.go

示例8: SecondTableInAEnd

func SecondTableInAEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() }
開發者ID:neuronesb,項目名稱:flatbuffers,代碼行數:1,代碼來源:SecondTableInA.go

示例9: PayloadEnd

func PayloadEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() }
開發者ID:mrares,項目名稱:no,代碼行數:1,代碼來源:Payload.go


注:本文中的github.com/google/flatbuffers/go.Builder.EndObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。