
    O}bg	                     ,    d dl mZ  G d d          ZdS )    )c_void_pc                   ^    e Zd ZdZdZeZdZeZ	e
d             Zej        d             Zd ZdS )CPointerBasezz
    Base class for objects that have a pointer access property
    that controls access to the underlying C pointer.
    Nc                 b    | j         r| j         S |                     d| j        j        z            )NzNULL %s pointer encountered.)_ptrnull_ptr_exception_class	__class____name__selfs    i/home/e360mart.nyusoft.in/public_html/e360mart_env/lib/python3.11/site-packages/django/contrib/gis/ptr.pyptrzCPointerBase.ptr   s5     9 	9++,JT^Md,deee    c                     |4t          || j                  st          dt          |          z            || _        d S )NzIncompatible pointer type: %s.)
isinstanceptr_type	TypeErrortyper   )r   r   s     r   r   zCPointerBase.ptr   s>     z#t}==<tCyyHIII			r   c                     | j         rB| j        r=	 |                      | j                   dS # t          t          t
          f$ r Y dS w xY wdS dS )z9
        Free the memory used by the C++ object.
        N)
destructorr   r   AttributeErrorImportErrorr   r   s    r   __del__zCPointerBase.__del__   ss     ? 	ty 	)))))"K;   	 	 	 	s   , AA)r
   
__module____qualname____doc__r   r   r   r   r   r   propertyr   setterr    r   r   r   r      s}          DHJ-f f Xf 	Z  Z    r   r   N)ctypesr   r   r   r   r   <module>r!      sI         " " " " " " " " " "r   