
    h                     2    S SK Jr  S SK Jr   " S S\5      rg)   )encode)number_typesc                   d    \ rS rSrSrSrS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rSrg)Table   zTable wraps a byte slice and provides read access to its data.

The variable `Pos` indicates the root of the FlatBuffers object therein.
)BytesPosc                 f    [         R                  " U[         R                  5        Xl        X l        g )N)Nenforce_numberUOffsetTFlagsr   r	   )selfbufposs      K/var/www/fran/franai/venv/lib/python3.13/site-packages/flatbuffers/table.py__init__Table.__init__   s     S!//*JH    c                     U R                   U R                  [        R                  U R                   5      -
  nU R                  [        R                  U5      nX:  a"  U R                  [        R                  X!-   5      $ g)zpOffset provides access into the Table's vtable.

Deprecated fields are ignored by checking the vtable's length.
    )r	   Getr   SOffsetTFlagsVOffsetTFlags)r   vtableOffsetvtable	vtableEnds       r   OffsetTable.Offset!   sZ     XX$((;;F&1IXXaoov'<==r   c                     [         R                  " U[         R                  5        U[        R                  " [         R                  R
                  U R                  U5      -   $ )z:Indirect retrieves the relative offset stored at `offset`.)r   r   r   r   r   packer_typer   )r   offs     r   IndirectTable.Indirect-   s<    S!//*AOO77SIIIr   c                    [         R                  " U[         R                  5        U[        R                  " [         R                  R
                  U R                  U5      -  nU[         R                  R                  -   n[        R                  " [         R                  R
                  U R                  U5      n[        U R                  X"U-    5      $ )z<String gets a string from data stored inside the flatbuffer.)	r   r   r   r   r   r    r   	bytewidthbytes)r   r!   startlengths       r   StringTable.String2   s    S!//*6::aoo114::sCCC!//+++EZZ33TZZEFEFN344r   c                 Z   [         R                  " U[         R                  5        XR                  -  nU[        R
                  " [         R                  R                  U R                  U5      -  n[        R
                  " [         R                  R                  U R                  U5      nU$ )z^VectorLen retrieves the length of the vector whose offset is stored

at "off" in this object.
)r   r   r   r	   r   r   r    r   )r   r!   rets      r   	VectorLenTable.VectorLen:   sm    
 S!//*88OC6::aoo114::sCCC
**Q__00$**c
BCJr   c                     [         R                  " U[         R                  5        XR                  -  nXR	                  [         R                  U5      -   nU[         R                  R
                  -  nU$ )zbVector retrieves the start of data of the vector whose offset is

stored at "off" in this object.
)r   r   r   r	   r   r%   )r   r!   xs      r   VectorTable.VectorF   sS    
 S!//*88OChhq,,A	"	""AHr   c                    [        U5      [        L d   e[        R                  " U[        R                  5        X R
                  -  nX R                  [        R                  U5      -   Ul        U R                  Ul        g)zUUnion initializes any Table-derived type to point to the union at

the given offset.
N)typer   r   r   r   r	   r   r   )r   t2r!   s      r   UnionTable.UnionS   sY    
 8uS!//*88OC88AOOS11BFzzBHr   c                     [         R                  " U[         R                  5        UR                  [        R
                  " UR                  U R                  U5      5      $ )zNGet retrieves a value of the type specified by `flags`  at the

given offset.
)r   r   r   py_typer   r   r    r   )r   flagsr!   s      r   r   	Table.Get_   s>    
 S!//*==E$5$5tzz3GHHr   c                     [         R                  " U[         R                  5        Ub  [         R                  " X#5        U R                  U5      nUS:X  a  U$ U R	                  X0R
                  U-   5      $ )Nr   )r   r   r   r   r   r	   )r   slotdvalidator_flagsr!   s        r   GetSlotTable.GetSlotg   s[    T1??+"q*
++d
C
axh88OXX^44r   c                     U R                  U5      nU R                  U5      n[        R                  " U5      n[        R
                  " XPR                  XC5      $ )zGetVectorAsNumpy returns the vector that starts at `Vector(off)`

as a numpy array with the type specified by `flags`. The array is
a `view` into Bytes, so modifying the returned array will
modify Bytes in place.
)r1   r-   r   to_numpy_typer   GetVectorAsNumpyr   )r   r:   r!   offsetr(   numpy_dtypes         r   rD   Table.GetVectorAsNumpyp   sE     [[F^^C F//%(K"";

FKKr   c                 p    [         R                  " U5      n[        R                  " X@R                  X25      $ )zGetArrayAsNumpy returns the array with fixed width that starts at `Vector(offset)`

with length `length` as a numpy array with the type specified by `flags`.
The
array is a `view` into Bytes so modifying the returned will modify Bytes in
place.
)r   rC   r   rD   r   )r   r:   r!   r(   rF   s        r   GetArrayAsNumpyTable.GetArrayAsNumpy|   s)     //%(K"";

FHHr   c                     [         R                  " U[         R                  5        [         R                  " U[         R                  5        U R                  U5      nUS:X  a  U$ U$ )zGetVOffsetTSlot retrieves the VOffsetT that the given vtable location

points to. If the vtable value is zero, the default value `d`
will be returned.
r   )r   r   r   r   )r   r=   r>   r!   s       r   GetVOffsetTSlotTable.GetVOffsetTSlot   sK     T1??+Q(
++d
C
axhJr   N)__name__
__module____qualname____firstlineno____doc__	__slots__r   r   r"   r)   r-   r1   r6   r   r@   rD   rI   rL   __static_attributes__ r   r   r   r      sN    
 )
J
5

I5
L	Ir   r   N) r   r   r   objectr   rU   r   r   <module>rX      s     AF Ar   