
    ha                     @   S SK r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJrJ	r	  SS	KJ
r
  SS
KJrJrJr  \	" 5       r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      rSr " S S\5      rS rg)    N   )compat)encode)number_types)packer)memoryview_type)NumpyRequiredForThisFeatureimport_numpy)
range_func)SOffsetTFlagsUOffsetTFlagsVOffsetTFlagsc                       \ rS rSrSrSrg)OffsetArithmeticError!   zError caused by an Offset arithmetic error.

Probably caused by bad writing of fields. This is considered an unreachable
situation in normal circumstances.
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       M/var/www/fran/franai/venv/lib/python3.13/site-packages/flatbuffers/builder.pyr   r   !   s     r   r   c                       \ rS rSrSrSrg)IsNotNestedError+   zQError caused by using a Builder to write Object data when not inside

an Object.
r   Nr   r   r   r   r   r   +       
 r   r   c                       \ rS rSrSrSrg)IsNestedError4   z[Error caused by using a Builder to begin an Object when an Object is

already being built.
r   Nr   r   r   r   r!   r!   4   r   r   r!   c                       \ rS rSrSrSrg)StructIsNotInlineError=   zaError caused by using a Builder to write a Struct at a location that

is not the current Offset.
r   Nr   r   r   r   r$   r$   =   r   r   r$   c                       \ rS rSrSrSrg)BuilderSizeErrorF   zQError caused by causing a Builder to exceed the hardcoded limit of 2

gigabytes.
r   Nr   r   r   r   r'   r'   F   r   r   r'   c                       \ rS rSrSrSrg)BuilderNotFinishedErrorO   z=Error caused by not calling `Finish` before calling `Output`.r   Nr   r   r   r   r*   r*   O   s    Er   r*   c                       \ rS rSrSrSrg)EndVectorLengthMismatchedU   z`The number of elements passed to EndVector does not match the number

specified in StartVector.
r   Nr   r   r   r   r-   r-   U   r   r   r-      c                      \ rS rSrSrSr SrSCS jrSDS j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SES jrSFS jrSFS jrS rS rS rS rS rS rSES jrSES jrSES j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/ r0S0 r1S1 r2S2 r3S3 r4S4 r5S5 r6S6 r7S7 r8S8 r9S9 r:S: r;S; r<S< r=S= r>S> r?S? r@S@ rASA rBSBrCg)GBuilderc   ab  A Builder is used to construct one or more FlatBuffers.

Typically, Builder objects will be used from code generated by the `flatc`
compiler.

A Builder constructs byte buffers in a last-first manner for simplicity and
performance during reading.

Internally, a Builder is a state machine for creating FlatBuffer objects.

It holds the following internal state:
    - Bytes: an array of bytes.
    - current_vtable: a list of integers.
    - vtables: a hash of vtable entries.

Attributes:
  Bytes: The internal `bytearray` for the Builder.
  finished: A boolean determining if the Builder has been finalized.
)Bytescurrent_vtableheadminalign	objectEndvtablesnestedforceDefaultsfinishedvectorNumElemssharedStringsl        c                    SUs=::  a  [         R                  ::  d  O  Sn[        U5      e[        U5      U l        SU l        [        R                  " U5      U l        SU l	        SU l
        0 U l        SU l        SU l        0 U l        SU l        g)zWInitializes a Builder of size `initial_size`.

The internal buffer is grown as needed.
r   z;flatbuffers: Cannot create Builder larger than 2 gigabytes.Nr   F)r1   MAX_BUFFER_SIZEr'   	bytearrayr3   r4   r   py_typer5   r6   r7   r8   r9   r:   r=   r;   )selfinitialSizemsgs      r   __init__Builder.__init__   s     7 7 77IcS!!;'DJD%%k2DIDMDNDLDKDDDMr   Nc                     S U l         [        R                  " [        U R                  5      5      U l        SU l        S U l        0 U l        SU l	        SU l
        0 U l        S U l        SU l        g )Nr   F)r4   r   rA   lenr3   r5   r6   r7   r8   r9   r:   r=   r<   r;   rB   s    r   ClearBuilder.Clear   s_    D%%c$**o6DIDMDNDLDKDDDDMr   c                 r    U R                   (       d
  [        5       eU R                  U R                  5       S $ )at  Return the portion of the buffer that has been used for writing data.

This is the typical way to access the FlatBuffer data inside the
builder. If you try to access `Builder.Bytes` directly, you would need
to manually index it with `Head()`, since the buffer is constructed
backwards.

It raises BuilderNotFinishedError if the buffer has not been finished
with `Finish`.
N)r;   r*   r3   HeadrI   s    r   OutputBuilder.Output   s+     ==#%%::diikm$$r   c                     U R                  5         [        U5       Vs/ s H  nSPM     snU l        U R                  5       U l        SU l        gs  snf )z=StartObject initializes bookkeeping for writing a new object.r   TN)assertNotNestedr   r4   Offsetr7   r9   )rB   	numfields_s      r   StartObjectBuilder.StartObject   sI     	 '1&;<&;1&;<D[[]DNDK =s   Ac           	         U R                  S5        U R                  5       n/ nSn[        U R                  5       H*  nUS:X  a
  U(       a  M  OX-
  nSnUR	                  U5        M,     [        U5      nU R                  R                  U5      nUGc  [        U R                  5      S-
  nSnSnUS:  aJ  SnU R                  U   nUS-  nUS:X  a  U(       a  US-  nM0  OX-
  nSnU R                  U5        US:  a  MJ  [        R                  " XR                  -
  5      n	U R                  [        R                  " U	5      5        [        U R                  5      U-
  [        -   n
U
[        R                  R                   -  n
U R                  [        R                  " U
5      5        ["        R                  " [        U R$                  5      U-
  5      n[&        R(                  " [*        R,                  U R$                  U["        R                  " U R                  5       U-
  5      5        U R                  5       U R                  U'   O["        R                  " [        U R$                  5      U-
  5      n[        R                  " U5      U l        [&        R(                  " [*        R,                  U R$                  U R1                  5       ["        R                  " XQ-
  5      5        SU l        U$ )aX  WriteVtable serializes the vtable for the current object, if needed.

Before writing out the vtable, this checks pre-existing vtables for
equality to this one. If an equal vtable is found, point the object to
the existing vtable and return.

Because vtable values are sensitive to alignment of object data, not
all logically-equal vtables will be deduplicated.

A vtable has the following format:
  <VOffsetT: size of the vtable in bytes, including this value>
  <VOffsetT: size of the object in bytes, including the vtable offset>
  <VOffsetT: offset for a field> * N, where N is the number of fields
             in the schema for this type. Includes deprecated fields.
Thus, a vtable is made of 2 + N elements, each VOffsetT bytes wide.

An object has the following format:
  <SOffsetT: offset to this object's vtable (may be negative)>
  <byte: data>+
r   TFNr   )PrependSOffsetTRelativerR   reversedr4   appendtupler8   getrH   PrependVOffsetTr   rA   r7   r   VtableMetadataFieldsN	bytewidthr   r3   r   Writer   soffsetr5   rM   )rB   objectOffsetvtKeytrimelem	vt2Offsetitrailingoff
objectSizevBytesobjectStarts               r   WriteVtableBuilder.WriteVtable   ss   0 	  #;;=LED,,-	
  "ll4 . %LE  'I
 d!!
"Q
&ahdF""1%	Q19MH  ##$S! F( !(()FGj
=00<= 4&&'(25IIf)))f
=0089 "))#djj/L*HIkll
..
**



 <
=	 !KKMdll5 "))#djj/L*HIk''4di ll
..
**
))+


	 8
9	 Dr   c                 P    U R                  5         SU l        U R                  5       $ )z>EndObject writes data necessary to finish object construction.F)assertNestedr9   rn   rI   s    r   	EndObjectBuilder.EndObject<  s$    DKr   c                 F   [        U R                  5      [        R                  :X  a  Sn[	        U5      e[        [        U R                  5      S-  [        R                  5      nUS:X  a  Sn[        U5      nU R                  X2[        U R                  5      -
  S& X0l        g)zDoubles the size of the byteslice, and copies the old data towards

the end of the new buffer (since we build the buffer backwards).
z2flatbuffers: cannot grow buffer beyond 2 gigabytesr/   r   r   N)rH   r3   r1   r?   r'   minr@   )rB   rD   newSizebytes2s       r   growByteBufferBuilder.growByteBufferB  s    
 4::'111@cS!!#djj/A%w'>'>?G!|gwF*.**FS_$&'Jr   c                     U R                   $ )zGet the start of useful data in the underlying byte buffer.

Note: unlike other functions, this value is interpreted as from the
left.
)r5   rI   s    r   rM   Builder.HeadT  s     99r   c                 v    [         R                  " [        U R                  5      U R	                  5       -
  5      $ )z)Offset relative to the end of the buffer.)r   rA   rH   r3   rM   rI   s    r   rR   Builder.Offset_  s&      TZZ499;!>??r   c                 h    [        U5       H#  nU R                  S[        R                  5        M%     g)z'Pad places zeros at the current offset.r   N)r   Placer_   
Uint8Flags)rB   nrh   s      r   PadBuilder.Padc  s"    ]
jjALL! r   c                    XR                   :  a  Xl         [        U R                  5      U R                  5       -
  U-   ) S-   nX1S-
  -  nU R                  5       X1-   U-   :  a  [        U R                  5      nU R	                  5         U R
                  [        U R                  5      -   U-
  n[        R                  " U5      U l        U R                  5       X1-   U-   :  a  M  U R                  U5        g)a   Prep prepares to write an element of `size` after `additional_bytes`

have been written, e.g. if you write a string, you need to align
such the int length field is aligned to SizeInt32, and the string
data follows it directly.
If all you need to do is align, `additionalBytes` will be 0.
r   N)	r6   rH   r3   rM   rx   r5   r   rA   r   )rB   sizeadditionalBytes	alignSize
oldBufSizeupdated_heads         r   PrepBuilder.Preph  s     mmm tzz?TYY[0?BCqHII ))+	(?:
:tzz?j
YYTZZ0:=l''5di	 ))+	(?:
:
 	HHYr   c                    U R                  [        R                  R                  S5        XR	                  5       ::  d  Sn[        U5      eU R	                  5       U-
  [        R                  R                  -   nU R                  U5        g)zUPrependSOffsetTRelative prepends an SOffsetT, relative to where it

will be written.
r   %flatbuffers: Offset arithmetic error.N)r   r_   r   r`   rR   r   PlaceSOffsetTrB   rj   rD   off2s       r   rX   Builder.PrependSOffsetTRelative  e     	IIaoo''+;;= 3c!#&&;;=3!:!::Dtr   c                    U R                  [        R                  R                  S5        XR	                  5       ::  d  Sn[        U5      eU R	                  5       U-
  [        R                  R                  -   nU R                  U5        g)zUPrepends an unsigned offset into vector data, relative to where it

will be written.
r   r   N)r   r_   r   r`   rR   r   PlaceUOffsetTr   s       r   PrependUOffsetTRelativeBuilder.PrependUOffsetTRelative  r   r   c                     U R                  5         SU l        X l        U R                  [        R
                  R                  X-  5        U R                  X1U-  5        U R                  5       $ )zStartVector initializes bookkeeping for writing a new vector.

A vector has the following format:
  - <UOffsetT: number of elements in this vector>
  - <T: data>+, where T is the type of elements of this vector.
T)rQ   r9   r<   r   r_   Uint32Flagsr`   rR   )rB   elemSizenumElems	alignments       r   StartVectorBuilder.StartVector  sU     	DK"IIamm%%x':;IIiH,-;;=r   c                    U R                  5         SU l        U(       a3  [        R                  " S[        SS9  XR
                  :w  a
  [        5       eU R                  U R
                  5        SU l        U R                  5       $ )z>EndVector writes data necessary to finish vector construction.FznumElems is deprecated.r/   )
stacklevelN)	rq   r9   warningswarnDeprecationWarningr<   r-   r   rR   )rB   r   s     r   	EndVectorBuilder.EndVector  sm     	DK mm-/AaP	((	(')) 	t**+D;;=r   c                     XR                   ;   a  U R                   U   $ U R                  XU5      nX@R                   U'   U$ )zgCreateSharedString checks if the string is already written to the buffer

before calling CreateString.
)r=   CreateString)rB   sencodingerrorsrj   s        r   CreateSharedStringBuilder.CreateSharedString  sF     	""


A
0CqJr   c                    U R                  5         SU l        [        U[        R                  5      (       a  UR                  X#5      nO-[        U[        R                  5      (       a  UnO[        S5      eU R                  [        R                  R                  [        U5      S-   [        R                  R                  -  5        U R                  S[        R                  5        [        R                  " [        U5      5      n[        R                  " U R!                  5       U-
  5      U l        X@R$                  U R!                  5       U R!                  5       U-   & [        U5      U l        U R)                  5       $ )z>CreateString writes a null-terminated byte string as a vector.Tz!non-string passed to CreateStringr   r   )rQ   r9   
isinstancer   string_typesr   binary_types	TypeErrorr   r_   r   r`   rH   r   r   rA   rM   r5   r3   r<   r   )rB   r   r   r   xls         r   r   Builder.CreateString  s    	DK !V(())
((8
$a	Av**	+	+
a9::IIaoo''#a&1*8N8N)NOJJq!,,c!f%A%%diikAo6DI01JJtyy{TYY[1_-a&D>>r   c                 P   U R                  5         SU l        [        U[        R                  5      (       d  [        S5      eU R                  [        R                  R                  [        U5      [        R                  R                  -  5        [        R                  " [        U5      5      n[        R                  " U R                  5       U-
  5      U l        XR                  U R                  5       U R                  5       U-   & [        U5      U l        U R#                  5       $ )z"CreateString writes a byte vector.Tz*non-byte vector passed to CreateByteVector)rQ   r9   r   r   r   r   r   r_   r   r`   rH   r   rA   rM   r5   r3   r<   r   )rB   r   r   s      r   CreateByteVectorBuilder.CreateByteVector  s     	DK a,,--BCCIIaoo''Q!,,2H2H)HIc!f%A%%diikAo6DI01JJtyy{TYY[1_-a&D>>r   c                 8   [         c  [        S5      e[        U[         R                  5      (       d  [	        S5      eUR
                  R                  S;  a  [	        S5      eUR                  S:  a  [	        S5      eU R                  UR                  UR                  UR
                  R                  5        UR
                  R                  S   S:X  a  UnOUR                  S	S
9n[        R                  " UR                  UR                  -  5      n[        R                  " U R!                  5       U-
  5      U l        UR%                  SS9U R&                  U R!                  5       U R!                  5       U-   & UR                  U l        U R+                  5       $ )z7CreateNumpyVector writes a numpy array into the buffer.zNumpy was not found.z-non-numpy-ndarray passed to CreateNumpyVector)brh   ufz4numpy-ndarray holds elements of unsupported datatyper   z4multidimensional-ndarray passed to CreateNumpyVectorr   <F)inplaceC)order)npr	   r   ndarrayr   dtypekindndimr   itemsizer   r   strbyteswapr   rA   rM   r5   tobytesr3   r<   r   )rB   r   x_lendr   s       r   CreateNumpyVectorBuilder.CreateNumpyVector  s6    
z'(>??a$$EFFww||//LMMvvzLMMQZZ):):; 	ww{{1~fzz%z(f 	foo;<A%%diikAo6DI 17S0IDJJtyy{TYY[1_-&&D>>r   c                 :    U R                   (       d
  [        5       eg)z7Check that we are in the process of building an object.N)r9   r   rI   s    r   rq   Builder.assertNested(  s     ;; r   c                 :    U R                   (       a
  [        5       eg)zcCheck that no other objects are being built while making this object.

If not, raise an exception.
N)r9   r!   rI   s    r   rQ   Builder.assertNotNested.  s     {{O r   c                     [         R                  " U[         R                  5        XR                  5       :w  a  Sn[	        U5      eg)zStructs are always stored inline, so need to be created right

where they are used. You'll get this error if you created it
elsewhere.
zkflatbuffers: Tried to write a Struct at an Offset that is different from the current Offset of the Builder.N)r_   enforce_numberr   rR   r$   )rB   objrD   s      r   assertStructIsInlineBuilder.assertStructIsInline7  sA     S!//*
kkmA 
 #3'' r   c                 ^    U R                  5         U R                  5       U R                  U'   g)zKSlot sets the vtable key `voffset` to the current location in the

buffer.
N)rq   rR   r4   )rB   slotnums     r   SlotBuilder.SlotF  s&    
 	#';;=D r   c                    [         R                  " U[         R                  5        [         R                  R                  nUb  U[         R                  R                  -  nU(       a  U[         R                  R                  -  nU R                  U R                  U5        Ub  U R                  [         R                  R                  [        R                  5        [         R                  R                  SU5      n[        [        R                  S-
  SS5       H%  nU R                  X5   [         R                  5        M'     U R                  U5        U(       a\  [        U R                   5      U R#                  5       -
  n[         R                  " U[         R                  5        U R%                  U5        SU l        U R#                  5       $ )=Finish finalizes a buffer, pointing to the given `rootTable`.z>BBBBr   T)r_   r   r   r`   
Int32Flagsr   r6   r   FILE_IDENTIFIER_LENGTHstructunpackranger   r   r   rH   r3   rM   PrependInt32r;   )rB   	rootTable
sizePrefixfile_identifierprepSizerh   r   s          r   __FinishBuilder.__FinishP  s6   Y0((H"!,,(((h!,,(((hIIdmmX&"
ii))6+H+HI
 AoV22Q6B?!

?%q||4 @ 	  +_tyy{*dtQ\\*
DM99;r   c                 $    U R                  USUS9$ )r   Fr   _Builder__FinishrB   r   r   s      r   FinishBuilder.Finishn  s    ==E?=KKr   c                 $    U R                  USUS9$ )zWFinish finalizes a buffer, pointing to the given `rootTable`,

with the size prefixed.
Tr   r   r   s      r   FinishSizePrefixedBuilder.FinishSizePrefixedr  s    
 ==D/=JJr   c                 ^    U R                  UR                  S5        U R                  X!5        g )Nr   )r   r`   r   )rB   flagsrj   s      r   PrependBuilder.Prependz  s     IIeooq!JJsr   c                     Ub  [         R                  " X15        Ub  [         R                  " XA5        X4:w  d  U R                  (       a'  Ub#  U R                  X5        U R	                  U5        g g g N)r_   r   r:   r   r   )rB   r   or   ds        r   PrependSlotBuilder.PrependSlot~  sX    }q }q v$$$
ll5
iil *7$r   c                 F    U R                   " [        R                  /UQ76   g r   )r   r_   	BoolFlagsrB   argss     r   PrependBoolSlotBuilder.PrependBoolSlot      Q[[(4(r   c                 F    U R                   " [        R                  /UQ76   g r   r   r_   r   r   s     r   PrependByteSlotBuilder.PrependByteSlot      Q\\)D)r   c                 F    U R                   " [        R                  /UQ76   g r   r  r   s     r   PrependUint8SlotBuilder.PrependUint8Slot  r  r   c                 F    U R                   " [        R                  /UQ76   g r   )r   r_   Uint16Flagsr   s     r   PrependUint16SlotBuilder.PrependUint16Slot      Q]]*T*r   c                 F    U R                   " [        R                  /UQ76   g r   )r   r_   r   r   s     r   PrependUint32SlotBuilder.PrependUint32Slot  r  r   c                 F    U R                   " [        R                  /UQ76   g r   )r   r_   Uint64Flagsr   s     r   PrependUint64SlotBuilder.PrependUint64Slot  r  r   c                 F    U R                   " [        R                  /UQ76   g r   )r   r_   	Int8Flagsr   s     r   PrependInt8SlotBuilder.PrependInt8Slot  r  r   c                 F    U R                   " [        R                  /UQ76   g r   )r   r_   
Int16Flagsr   s     r   PrependInt16SlotBuilder.PrependInt16Slot  r  r   c                 F    U R                   " [        R                  /UQ76   g r   )r   r_   r   r   s     r   PrependInt32SlotBuilder.PrependInt32Slot  r  r   c                 F    U R                   " [        R                  /UQ76   g r   )r   r_   
Int64Flagsr   s     r   PrependInt64SlotBuilder.PrependInt64Slot  r  r   c                 F    U R                   " [        R                  /UQ76   g r   )r   r_   Float32Flagsr   s     r   PrependFloat32SlotBuilder.PrependFloat32Slot      Q^^+d+r   c                 F    U R                   " [        R                  /UQ76   g r   )r   r_   Float64Flagsr   s     r   PrependFloat64SlotBuilder.PrependFloat64Slot  r)  r   c                 v    X#:w  d  U R                   (       a#  U R                  U5        U R                  U5        gg)zPrependUOffsetTRelativeSlot prepends an UOffsetT onto the object at

vtable slot `o`. If value `x` equals default `d`, then the slot will
be set to zero and no other data will be written.
N)r:   r   r   )rB   r   r   r   s       r   PrependUOffsetTRelativeSlot#Builder.PrependUOffsetTRelativeSlot  s/     	v##
""1%
iil $r   c                     [         R                  " U[         R                  5        X#:w  a#  U R                  U5        U R	                  U5        gg)zPrependStructSlot prepends a struct onto the object at vtable slot `o`.

Structs are stored inline, so nothing additional is being added. In
generated code, `d` is always 0.
N)r_   r   r   r   r   )rB   vr   r   s       r   PrependStructSlotBuilder.PrependStructSlot  s;     Q(v
"
iil r   c                 D    U R                  [        R                  U5        g)zLPrepend a `bool` to the Builder buffer.

Note: aligns and checks for space.
N)r   r_   r   rB   r   s     r   PrependBoolBuilder.PrependBool      
 	LLa r   c                 D    U R                  [        R                  U5        g)zLPrepend a `byte` to the Builder buffer.

Note: aligns and checks for space.
Nr   r_   r   r6  s     r   PrependByteBuilder.PrependByte      
 	LLq!r   c                 D    U R                  [        R                  U5        g)zNPrepend an `uint8` to the Builder buffer.

Note: aligns and checks for space.
Nr;  r6  s     r   PrependUint8Builder.PrependUint8  r>  r   c                 D    U R                  [        R                  U5        g)zOPrepend an `uint16` to the Builder buffer.

Note: aligns and checks for space.
N)r   r_   r  r6  s     r   PrependUint16Builder.PrependUint16      
 	LL"r   c                 D    U R                  [        R                  U5        g)zOPrepend an `uint32` to the Builder buffer.

Note: aligns and checks for space.
N)r   r_   r   r6  s     r   PrependUint32Builder.PrependUint32  rE  r   c                 D    U R                  [        R                  U5        g)zOPrepend an `uint64` to the Builder buffer.

Note: aligns and checks for space.
N)r   r_   r  r6  s     r   PrependUint64Builder.PrependUint64  rE  r   c                 D    U R                  [        R                  U5        g)zMPrepend an `int8` to the Builder buffer.

Note: aligns and checks for space.
N)r   r_   r  r6  s     r   PrependInt8Builder.PrependInt8  r9  r   c                 D    U R                  [        R                  U5        g)zNPrepend an `int16` to the Builder buffer.

Note: aligns and checks for space.
N)r   r_   r  r6  s     r   PrependInt16Builder.PrependInt16  r>  r   c                 D    U R                  [        R                  U5        g)zNPrepend an `int32` to the Builder buffer.

Note: aligns and checks for space.
N)r   r_   r   r6  s     r   r   Builder.PrependInt32  r>  r   c                 D    U R                  [        R                  U5        g)zNPrepend an `int64` to the Builder buffer.

Note: aligns and checks for space.
N)r   r_   r"  r6  s     r   PrependInt64Builder.PrependInt64  r>  r   c                 D    U R                  [        R                  U5        g)zOPrepend a `float32` to the Builder buffer.

Note: aligns and checks for space.
N)r   r_   r&  r6  s     r   PrependFloat32Builder.PrependFloat32
      
 	LL#r   c                 D    U R                  [        R                  U5        g)zOPrepend a `float64` to the Builder buffer.

Note: aligns and checks for space.
N)r   r_   r+  r6  s     r   PrependFloat64Builder.PrependFloat64  rZ  r   c                     Xl         g)zIn order to save space, fields that are set to their default value

don't get serialized into the buffer. Forcing defaults provides a
way to manually disable this optimization. When set to `True`, will
always serialize default values.
N)r:   )rB   r:   s     r   ForceDefaultsBuilder.ForceDefaults  s
     'r   c                 D    U R                  [        R                  U5        g r   )r   r_   r   r6  s     r   r]   Builder.PrependVOffsetT$  s    LL!$r   c                     [         R                  " X5        U R                  UR                  -
  U l        [        R
                  " UR                  U R                  U R                  5       U5        g)zcPlace prepends a value specified by `flags` to the Builder,

without checking for available space.
N)	r_   r   r5   r`   r   ra   packer_typer3   rM   )rB   r   r   s      r   r   Builder.Place'  sH     Q		EOO+DI
LL""DJJ		Q?r   c                 $   [         R                  " U[         R                  5        U R                  [         R                  R                  -
  U l        [
        R                  " [        R                  U R                  U R                  5       U5        g)zOPlaceVOffsetT prepends a VOffsetT to the Builder, without checking

for space.
N)r_   r   r   r5   r`   r   ra   r   voffsetr3   rM   r6  s     r   PlaceVOffsetTBuilder.PlaceVOffsetT1  R    
 Q(		AOO555DI
LLTYY[!<r   c                 $   [         R                  " U[         R                  5        U R                  [         R                  R                  -
  U l        [
        R                  " [        R                  U R                  U R                  5       U5        g)zOPlaceSOffsetT prepends a SOffsetT to the Builder, without checking

for space.
N)r_   r   r   r5   r`   r   ra   r   rb   r3   rM   r6  s     r   r   Builder.PlaceSOffsetT:  rj  r   c                 $   [         R                  " U[         R                  5        U R                  [         R                  R                  -
  U l        [
        R                  " [        R                  U R                  U R                  5       U5        g)zOPlaceUOffsetT prepends a UOffsetT to the Builder, without checking

for space.
N)r_   r   r   r5   r`   r   ra   r   uoffsetr3   rM   r6  s     r   r   Builder.PlaceUOffsetTC  rj  r   )r3   r4   r;   r:   r5   r6   r9   r7   r=   r<   r8   )i   )returnNr   )zutf-8strict)Dr   r   r   r   r   	__slots__r?   rE   rJ   rN   rU   rn   rr   rx   rM   rR   r   r   rX   r   r   r   r   r   r   r   rq   rQ   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r#  r'  r,  r/  r3  r7  r<  r@  rC  rG  rJ  rM  rP  r   rU  rX  r\  r_  r]   r   rh  r   r   r   r   r   r   r1   r1   c   sM   *)
 /.%$jX$@"
4 "$6,"J(1<LK)**+++)***,,	
!""###!"""$$'%@===r   r1   c                    [         R                  " U[         R                  5        [        U 5      [         R                  R
                  -  [        U5      :w  a  g[        U 5       H^  u  p4[        R                  " [        R                  X#[         R                  R
                  -  5      nUS:X  a  US:X  a  MS  X-
  nXV:w  d  M^    g   g)z=vtableEqual compares an unwritten vtable to a written vtable.Fr   T)r_   r   r   rH   r   r`   	enumerater   Getr   rg  )arm   r   rh   rf   r   ys          r   vtableEqualrx  P  s     ;0Vaoo'''3q611ga

6>>1!//*C*C&CDA 	Av$!)


a	
  
r   )r    r   r   r   r_   r   r   r	   r
   r   r   r   r   r   RuntimeErrorr   r   r!   r$   r'   r*   r-   r^   objectr1   rx  r   r   r   <module>r|     s         # =  G G^L | L \ | l    g=f g=Zr   