
    mbi                     :    d dl mZ d dl mZ  G d de          ZdS )   )encode)number_typesc                   ^    e Zd ZdZdZd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd ZdS )TablezTable wraps a byte slice and provides read access to its data.

  The variable `Pos` indicates the root of the FlatBuffers object therein.
  )BytesPosc                 `    t          j        |t           j                   || _        || _        d S )N)Nenforce_numberUOffsetTFlagsr   r   )selfbufposs      a/var/www/html/mdtn/previsions/meteo_cartes/venv/lib/python3.11/site-packages/flatbuffers/table.py__init__zTable.__init__   s)    S!/***DJDHHH    c                     | j         |                     t          j        | j                   z
  }|                     t          j        |          }||k     r#|                     t          j        ||z             S dS )zxOffset 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   OffsetzTable.Offset!   sb     X$(;;;F&11IiXXaov'<===1r   c                     t          j        |t           j                   |t          j        t           j        j        | j        |          z   S )z:Indirect retrieves the relative offset stored at `offset`.)r
   r   r   r   r   packer_typer   )r   offs     r   IndirectzTable.Indirect-   s7    S!/***AO7SIIIIr   c                 T   t          j        |t           j                   |t          j        t           j        j        | j        |          z  }|t           j        j        z   }t          j        t           j        j        | j        |          }t          | j        |||z                      S )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   StringzTable.String2   s}    S!/***6:ao14:sCCCC!/++EZ3TZEEFEEFN23444r   c                    t          j        |t           j                   || j        z  }|t	          j        t           j        j        | j        |          z  }t	          j        t           j        j        | j        |          }|S )zfVectorLen 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   	VectorLenzTable.VectorLen:   sb    
 S!/***48OC6:ao14:sCCCC
*Q_0$*c
B
BCJr   c                     t          j        |t           j                   || j        z  }||                     t           j        |          z   }|t           j        j        z  }|S )zjVector 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   VectorzTable.VectorF   sR    
 S!/***48OCdhhq,,,A	""AHr   c                     t          |          t          u sJ t          j        |t          j                   || j        z  }||                     t          j        |          z   |_        | j        |_        dS )z]Union 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   UnionzTable.UnionS   sd    
 88uS!/***48OC488AOS111BFzBHHHr   c                     t          j        |t           j                   |                    t	          j        |j        | j        |                    S )zVGet 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   z	Table.Get_   s>    
 S!/***==E$5tz3GGHHHr   c                     t          j        |t           j                   |t          j        ||           |                     |          }|dk    r|S |                     || j        |z             S )Nr   )r
   r   r   r   r   r   )r   slotdvalidator_flagsr   s        r   GetSlotzTable.GetSlotg   si    T1?+++"q/***
++d

C
axxh88OTX^444r   c                     |                      |          }|                     |          }t          j        |          }t	          j        || j        ||          S )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.
    )r+   r(   r
   to_numpy_typer   GetVectorAsNumpyr   )r   r2   r   offsetr$   numpy_dtypes         r   r:   zTable.GetVectorAsNumpyp   sN     [[F^^C  F/%((K";
FFKKKr   c                 b    t          j        |          }t          j        || j        ||          S )a	  GetArrayAsNumpy 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
   r9   r   r:   r   )r   r2   r   r$   r<   s        r   GetArrayAsNumpyzTable.GetArrayAsNumpy|   s,     /%((K";
FCHHHr   c                     t          j        |t           j                   t          j        |t           j                   |                     |          }|dk    r|S |S )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   r4   r5   r   s       r   GetVOffsetTSlotzTable.GetVOffsetTSlot   sR     T1?+++Q(((
++d

C
axxhJr   N)__name__
__module____qualname____doc__	__slots__r   r   r   r%   r(   r+   r/   r   r7   r:   r>   r@    r   r   r   r      s         
 )  
 
 
J J J
5 5 5
 
 
  
 
 
I I I5 5 5
L 
L 
L	I 	I 	I    r   r   N) r   r   r
   objectr   rF   r   r   <module>rI      si               A A A A AF A A A A Ar   