
    rid                     2    S SK Jr  S SK Jr   " S S\5      rg)   )encode)number_typesc                   ^    \ 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      W/home/kim/smarthome/piper_models/venv/lib/python3.13/site-packages/flatbuffers/table.py__init__Table.__init__   s     	aoo.
    c                     U R                   U R                  [        R                  U R                   5      -
  nU R                  [        R                  U5      nX:  a"  U R                  [        R                  X!-   5      $ g)zoOffset 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    
 DHHQ__dhh??HHQ__f5	#88AOOV-BCC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<    	aoo.VZZ ; ;TZZMMMr   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.String0   s    	aoo.vzz!//55tzz3GGaoo///AOO77SITZZFl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.VectorLen8   sm     	
aoo.xxvzz!//55tzz3GGjj44djj#F
r   c                     [         R                  " U[         R                  5        XR                  -  nXR	                  [         R                  U5      -   nU[         R                  R
                  -  nU$ )z`Vector 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.VectorB   sS     	
aoo.xx((1??C00	Q__&&&r   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)zSUnion 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.UnionM   sY     Bx5   	aoo.xxxx55::r   c                     [         R                  " U[         R                  5        UR                  [        R
                  " UR                  U R                  U5      5      $ )zN
Get 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.GetW   s>    
 	
aoo.}}VZZ(9(94::sKLLr   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.GetSlot_   s[    	q/&Q0kk$!8HxxC88r   c                     U R                  U5      nU R                  U5      n[        R                  " U5      n[        R
                  " XPR                  XC5      $ )z
GetVectorAsNumpy 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.GetVectorAsNumpyh   sE     S!$ooe,&&{JJOOr   c                     [         R                  " U[         R                  5        [         R                  " U[         R                  5        U R                  U5      nUS:X  a  U$ U$ )z
GetVOffsetTSlot 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.GetVOffsetTSlott   sK     	
q/	AOO,kk$!8
r   N)__name__
__module____qualname____firstlineno____doc__	__slots__r   r   r"   r)   r-   r1   r6   r   r@   rD   rI   __static_attributes__ r   r   r   r      sI    P !I	N
5	M9
Pr   r   N) r   r   r   objectr   rR   r   r   <module>rU      s     nF nr   