# automatically generated by the FlatBuffers compiler, do not modify

# namespace: aghast_generated

import flatbuffers

# ///////////////////////////////////////////////// histogram
class Histogram(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsHistogram(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = Histogram()
        x.Init(buf, n + offset)
        return x

    # Histogram
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Histogram
    def Axis(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Axis import Axis
            obj = Axis()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Histogram
    def AxisLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Histogram
    def CountsType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # Histogram
    def Counts(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            from flatbuffers.table import Table
            obj = Table(bytearray(), 0)
            self._tab.Union(obj, o)
            return obj
        return None

    # Histogram
    def Profile(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Profile import Profile
            obj = Profile()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Histogram
    def ProfileLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Histogram
    def AxisCovariances(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Covariance import Covariance
            obj = Covariance()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Histogram
    def AxisCovariancesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Histogram
    def ProfileCovariances(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Covariance import Covariance
            obj = Covariance()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Histogram
    def ProfileCovariancesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Histogram
    def FunctionsLookup(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return ""

    # Histogram
    def FunctionsLookupLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Histogram
    def Functions(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Function import Function
            obj = Function()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Histogram
    def FunctionsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

def HistogramStart(builder): builder.StartObject(8)
def HistogramAddAxis(builder, axis): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(axis), 0)
def HistogramStartAxisVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def HistogramAddCountsType(builder, countsType): builder.PrependUint8Slot(1, countsType, 0)
def HistogramAddCounts(builder, counts): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(counts), 0)
def HistogramAddProfile(builder, profile): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(profile), 0)
def HistogramStartProfileVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def HistogramAddAxisCovariances(builder, axisCovariances): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(axisCovariances), 0)
def HistogramStartAxisCovariancesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def HistogramAddProfileCovariances(builder, profileCovariances): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(profileCovariances), 0)
def HistogramStartProfileCovariancesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def HistogramAddFunctionsLookup(builder, functionsLookup): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(functionsLookup), 0)
def HistogramStartFunctionsLookupVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def HistogramAddFunctions(builder, functions): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(functions), 0)
def HistogramStartFunctionsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def HistogramEnd(builder): return builder.EndObject()
