Message.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // Code generated by the FlatBuffers compiler. DO NOT EDIT.
  2. package message_fbs
  3. import (
  4. flatbuffers "github.com/google/flatbuffers/go"
  5. )
  6. type Message struct {
  7. _tab flatbuffers.Table
  8. }
  9. func GetRootAsMessage(buf []byte, offset flatbuffers.UOffsetT) *Message {
  10. n := flatbuffers.GetUOffsetT(buf[offset:])
  11. x := &Message{}
  12. x.Init(buf, n+offset)
  13. return x
  14. }
  15. func GetSizePrefixedRootAsMessage(buf []byte, offset flatbuffers.UOffsetT) *Message {
  16. n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
  17. x := &Message{}
  18. x.Init(buf, n+offset+flatbuffers.SizeUint32)
  19. return x
  20. }
  21. func (rcv *Message) Init(buf []byte, i flatbuffers.UOffsetT) {
  22. rcv._tab.Bytes = buf
  23. rcv._tab.Pos = i
  24. }
  25. func (rcv *Message) Table() flatbuffers.Table {
  26. return rcv._tab
  27. }
  28. func (rcv *Message) SeqDelta() int32 {
  29. o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
  30. if o != 0 {
  31. return rcv._tab.GetInt32(o + rcv._tab.Pos)
  32. }
  33. return 0
  34. }
  35. func (rcv *Message) MutateSeqDelta(n int32) bool {
  36. return rcv._tab.MutateInt32Slot(4, n)
  37. }
  38. func (rcv *Message) TsMsDelta() int32 {
  39. o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
  40. if o != 0 {
  41. return rcv._tab.GetInt32(o + rcv._tab.Pos)
  42. }
  43. return 0
  44. }
  45. func (rcv *Message) MutateTsMsDelta(n int32) bool {
  46. return rcv._tab.MutateInt32Slot(6, n)
  47. }
  48. func (rcv *Message) Properties(obj *NameValue, j int) bool {
  49. o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
  50. if o != 0 {
  51. x := rcv._tab.Vector(o)
  52. x += flatbuffers.UOffsetT(j) * 4
  53. x = rcv._tab.Indirect(x)
  54. obj.Init(rcv._tab.Bytes, x)
  55. return true
  56. }
  57. return false
  58. }
  59. func (rcv *Message) PropertiesLength() int {
  60. o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
  61. if o != 0 {
  62. return rcv._tab.VectorLen(o)
  63. }
  64. return 0
  65. }
  66. func (rcv *Message) Key() []byte {
  67. o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
  68. if o != 0 {
  69. return rcv._tab.ByteVector(o + rcv._tab.Pos)
  70. }
  71. return nil
  72. }
  73. func (rcv *Message) Data() []byte {
  74. o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
  75. if o != 0 {
  76. return rcv._tab.ByteVector(o + rcv._tab.Pos)
  77. }
  78. return nil
  79. }
  80. func MessageStart(builder *flatbuffers.Builder) {
  81. builder.StartObject(5)
  82. }
  83. func MessageAddSeqDelta(builder *flatbuffers.Builder, seqDelta int32) {
  84. builder.PrependInt32Slot(0, seqDelta, 0)
  85. }
  86. func MessageAddTsMsDelta(builder *flatbuffers.Builder, tsMsDelta int32) {
  87. builder.PrependInt32Slot(1, tsMsDelta, 0)
  88. }
  89. func MessageAddProperties(builder *flatbuffers.Builder, properties flatbuffers.UOffsetT) {
  90. builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(properties), 0)
  91. }
  92. func MessageStartPropertiesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
  93. return builder.StartVector(4, numElems, 4)
  94. }
  95. func MessageAddKey(builder *flatbuffers.Builder, key flatbuffers.UOffsetT) {
  96. builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(key), 0)
  97. }
  98. func MessageAddData(builder *flatbuffers.Builder, data flatbuffers.UOffsetT) {
  99. builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(data), 0)
  100. }
  101. func MessageEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
  102. return builder.EndObject()
  103. }