
    5?h:                         S r SrSSKJr  SSKJr  SSKJr  \R                  " 5       S:X  a  SSKJ	r
  OSSKJr
  \
R                  r " S	 S
\5      r\" 5       rS rg)ao  Provides a factory class for generating dynamic messages.

The easiest way to use this class is if you have access to the FileDescriptor
protos containing the messages you want to create you can just do the following:

message_classes = message_factory.GetMessages(iterable_of_file_descriptors)
my_proto_instance = message_classes['some.proto.package.MessageName']()
z"matthewtoia@google.com (Matt Toia)    )api_implementation)descriptor_pool)messagecpp)cpp_message)python_messagec                   4    \ rS rSrSrS	S jrS rS rS rSr	g)
MessageFactory8   z@Factory for creating Proto2 messages from descriptors in a pool.Nc                 X    U=(       d    [         R                  " 5       U l        0 U l        g)zInitializes a new factory.N)r   DescriptorPoolpool_classes)selfr   s     g/var/www/ev-aguas/ev-aguas-proceso/venv/lib/python3.13/site-packages/google/protobuf/message_factory.py__init__MessageFactory.__init__;   s     8668DI DM    c                     XR                   ;  a!  U R                  U5      nX R                   U'   U$ U R                   U   $ )a)  Obtains a proto2 message class based on the passed in descriptor.

Passing a descriptor with a fully qualified name matching a previous
invocation will cause the same class to be returned.

Args:
  descriptor: The descriptor to build from.

Returns:
  A class describing the passed in descriptor.
)r   CreatePrototype)r   
descriptorresult_classs      r   GetPrototypeMessageFactory.GetPrototypeB   sA     &))*5l #/mmJ==$$r   c                    UR                   n[        U[        R                  4USS.5      nXl        X0R
                  U'   UR                   H1  nUR                  (       d  M  U R                  UR                  5        M3     UR                  R                   Hb  nUR                  U R
                  ;  a  U R                  UR                  5        U R
                  UR                     nUR                  U5        Md     U$ )a  Builds a proto2 message class based on the passed in descriptor.

Don't call this function directly, it always creates a new class. Call
GetPrototype() instead. This method is meant to be overridden in subblasses
to perform additional operations on the newly constructed class.

Args:
  descriptor: The descriptor to build from.

Returns:
  A class describing the passed in descriptor.
N)
DESCRIPTOR
__module__)name _GENERATED_PROTOCOL_MESSAGE_TYPEr   Message_FACTORYr   fieldsmessage_typer   r   
extensionscontaining_typeRegisterExtension)r   r   descriptor_namer   field	extensionextended_classs          r   r   MessageFactory.CreatePrototypeW   s     !ooO3	$	
L ! !-MM*""				%,,- # ",,77			"	"$--	7)334}}Y%>%>?n&&y1	 8
 r   c                    0 nU H  nU R                   R                  U5      nUR                  R                  5        H   nU R	                  U5      X%R
                  '   M"     UR                  R                  5        Hb  nUR                  U R                  ;  a  U R	                  UR                  5        U R                  UR                     nUR                  U5        Md     M     U$ )a  Gets all the messages from a specified file.

This will find and resolve dependencies, failing if the descriptor
pool cannot satisfy them.

Args:
  files: The file names to extract messages from.

Returns:
  A dictionary mapping proto names to the message classes. This will include
  any dependent messages as well as any messages defined in the same file as
  a specified message.
)
r   FindFileByNamemessage_types_by_namevaluesr   	full_nameextensions_by_namer%   r   r&   )r   filesresult	file_name	file_descdescr)   r*   s           r   GetMessagesMessageFactory.GetMessages{   s     F	))**95i1188:$!%!2!24!8~~ ; !33::<)$$DMM9


I55
6y'@'@A((3	 = & Mr   )r   r   N)
__name__r   __qualname____firstlineno____doc__r   r   r   r7   __static_attributes__ r   r   r
   r
   8   s    H%*"H"r   r
   c                   ^^ U  Vs0 sH  oR                   U_M     snmUU4S jmT(       a"  T" TR                  5       S   5        T(       a  M"  [        R                  U  Vs/ sH  oR                   PM     sn5      $ s  snf s  snf )aP  Builds a dictionary of all the messages available in a set of files.

Args:
  file_protos: Iterable of FileDescriptorProto to build messages out of.

Returns:
  A dictionary mapping proto names to the message classes. This will include
  any dependent messages as well as any messages defined in the same file as
  a specified message.
c                    > U R                    H"  nUT;   d  M  T" TR                  U5      5        M$     [        R                  R	                  U 5        g r9   )
dependencypopr!   r   Add)
file_protorB   _AddFilefile_by_names     r   rF   GetMessages.<locals>._AddFile   sB     ++
	|	#!!*-. , MMj!r      )r   popitemr!   r7   )file_protosrE   rF   rG   s     @@r   r7   r7      sw     ALL*//:-L," 	\!!#A&' 				M:M	NN M Ns   A="BN)r=   
__author__google.protobuf.internalr   google.protobufr   r   Typegoogle.protobuf.pyextr   message_implr   GeneratedProtocolMessageTyper   objectr
   r!   r7   r?   r   r   <module>rT      s^   > 2
 7 + #%?E $0#L#L  eV eP Or   