
    g                      $    d dl mZ  G d d      Zy)    )c_void_pc                   Z    e Zd ZdZdZeZdZeZ	e
d        Zej                  d        Zd Zy)CPointerBasezz
    Base class for objects that have a pointer access property
    that controls access to the underlying C pointer.
    Nc                     | j                   r| j                   S | j                  d| j                  j                  z        )NzNULL %s pointer encountered.)_ptrnull_ptr_exception_class	__class____name__selfs    n/var/www/python.vincentserveurtest.ovh/public_html/venv/lib/python3.12/site-packages/django/contrib/gis/ptr.pyptrzCPointerBase.ptr   s:     9999++*T^^-D-DD
 	
    c                 p    |-t        || j                        st        dt        |      z        || _        y )NzIncompatible pointer type: %s.)
isinstanceptr_type	TypeErrortyper   )r   r   s     r   r   zCPointerBase.ptr   s2     z#t}}=<tCyHII	r   c                     | j                   r*| j                  r	 | j                  | j                         yyy# t        t        t
        f$ r Y yw xY w)z9
        Free the memory used by the C++ object.
        N)
destructorr   r   AttributeErrorImportErrorr   r   s    r   __del__zCPointerBase.__del__!   sH     ??tyy)  )? #K; s   8 AA)r
   
__module____qualname____doc__r   r   r   r   r   r   propertyr   setterr    r   r   r   r      sM    
 DHJ-
 
 	ZZ r   r   N)ctypesr   r   r   r   r   <module>r!      s    % %r   