// Code generated by the FlatBuffers compiler. DO NOT EDIT.

package repo_fbs

import (
	flatbuffers "github.com/google/flatbuffers/go"
)

type Repo struct {
	_tab flatbuffers.Table
}

func GetRootAsRepo(buf []byte, offset flatbuffers.UOffsetT) *Repo {
	n := flatbuffers.GetUOffsetT(buf[offset:])
	x := &Repo{}
	x.Init(buf, n+offset)
	return x
}

func (rcv *Repo) Init(buf []byte, i flatbuffers.UOffsetT) {
	rcv._tab.Bytes = buf
	rcv._tab.Pos = i
}

func (rcv *Repo) Table() flatbuffers.Table {
	return rcv._tab
}

func (rcv *Repo) Refs(obj *DatasetRef, j int) bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		x := rcv._tab.Vector(o)
		x += flatbuffers.UOffsetT(j) * 4
		x = rcv._tab.Indirect(x)
		obj.Init(rcv._tab.Bytes, x)
		return true
	}
	return false
}

func (rcv *Repo) RefsLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

func RepoStart(builder *flatbuffers.Builder) {
	builder.StartObject(1)
}
func RepoAddRefs(builder *flatbuffers.Builder, refs flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(refs), 0)
}
func RepoStartRefsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func RepoEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
