B
    à%Q[õ  ã               @   s   d gZ G dd „ d eƒZdS )ÚOpenTypec               @   sV   e Zd ZdZddd„Zedd„ ƒZdd„ Zd	d
„ Zdd„ Z	dd„ Z
dd„ Zdd„ ZdS )r   aŽ  Create ASN.1 type map indexed by a value

    The *DefinedBy* object models the ASN.1 *DEFINED BY* clause which maps
    values to ASN.1 types in the context of the ASN.1 SEQUENCE/SET type.

    OpenType objects are duck-type a read-only Python :class:`dict` objects,
    however the passed `typeMap` is stored by reference.

    Parameters
    ----------
    name: :py:class:`str`
        Field name

    typeMap: :py:class:`dict`
        A map of value->ASN.1 type. It's stored by reference and can be
        mutated later to register new mappings.

    Examples
    --------
    .. code-block:: python

        openType = OpenType(
            'id',
            {1: Integer(),
             2: OctetString()}
        )
        Sequence(
            componentType=NamedTypes(
                NamedType('id', Integer()),
                NamedType('blob', Any(), openType=openType)
            )
        )
    Nc             C   s    || _ |d kri | _n|| _d S )N)Ú_OpenType__nameÚ_OpenType__typeMap)ÚselfÚnameZtypeMap© r   úXC:\Users\HIRONO~1\AppData\Local\Temp\pip-install-6i93dh7p\pyasn1\pyasn1\type\opentype.pyÚ__init__.   s    zOpenType.__init__c             C   s   | j S )N)r   )r   r   r   r   r   5   s    zOpenType.namec             C   s
   | j  ¡ S )N)r   Úvalues)r   r   r   r   r	   ;   s    zOpenType.valuesc             C   s
   | j  ¡ S )N)r   Úkeys)r   r   r   r   r
   >   s    zOpenType.keysc             C   s
   | j  ¡ S )N)r   Úitems)r   r   r   r   r   A   s    zOpenType.itemsc             C   s
   || j kS )N)r   )r   Úkeyr   r   r   Ú__contains__D   s    zOpenType.__contains__c             C   s
   | j | S )N)r   )r   r   r   r   r   Ú__getitem__G   s    zOpenType.__getitem__c             C   s
   t | jƒS )N)Úiterr   )r   r   r   r   Ú__iter__J   s    zOpenType.__iter__)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r	   r
   r   r   r   r   r   r   r   r   r      s   !
N)Ú__all__Úobjectr   r   r   r   r   Ú<module>   s   