o
    ƒælf   ã                   @   s   d dl mZ G dd„ dƒZdS )é    )Úc_void_pc                   @   sB   e Zd ZdZdZeZdZeZ	e
dd„ ƒZejdd„ ƒZdd„ ZdS )ÚCPointerBasezz
    Base class for objects that have a pointer access property
    that controls access to the underlying C pointer.
    Nc                 C   s   | j r| j S |  d| jj ¡‚)NzNULL %s pointer encountered.)Ú_ptrÚnull_ptr_exception_classÚ	__class__Ú__name__©Úself© r
   úZ/var/www/ticemtrilhas/avaliacao_env/lib/python3.10/site-packages/django/contrib/gis/ptr.pyÚptr   s
   
ÿzCPointerBase.ptrc                 C   s.   |d u st || jƒstdt|ƒ ƒ‚|| _d S )NzIncompatible pointer type: %s.)Ú
isinstanceÚptr_typeÚ	TypeErrorÚtyper   )r	   r   r
   r
   r   r      s   
c              
   C   sB   | j r| jrz	|   | j¡ W dS  tttfy   Y dS w dS dS )z9
        Free the memory used by the C++ object.
        N)Ú
destructorr   r   ÚAttributeErrorÚImportErrorr   r   r
   r
   r   Ú__del__!   s   ÿýzCPointerBase.__del__)r   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   Úpropertyr   Úsetterr   r
   r
   r
   r   r      s    
	
r   N)Úctypesr   r   r
   r
   r
   r   Ú<module>   s    