3
š(ƒh   ã               @   s,   d dl mZ d dlmZ G dd„ deƒZdS )é    )Úc_void_p)ÚGEOSExceptionc               @   s2   e Zd ZdZdZeZdd„ Zdd„ Ze	eeƒZ
dS )ÚGEOSBasez
    Base object for GEOS objects that has a pointer access property
    that controls access to the underlying C pointer.
    Nc             C   s    | j r| j S td| jj ƒ‚d S )Nz!NULL GEOS %s pointer encountered.)Ú_ptrr   Ú	__class__Ú__name__)Úself© r	   ú@/tmp/pip-install-q3hcpn_q/Django/django/contrib/gis/geos/base.pyÚ_get_ptr   s    zGEOSBase._get_ptrc             C   s(   |d kst || jƒr|| _ntdƒ‚d S )NzIncompatible pointer type)Ú
isinstanceÚptr_typer   Ú	TypeError)r   Úptrr	   r	   r
   Ú_set_ptr   s    zGEOSBase._set_ptr)r   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   Úpropertyr   r	   r	   r	   r
   r      s   	r   N)Úctypesr   Zdjango.contrib.gis.geos.errorr   Úobjectr   r	   r	   r	   r
   Ú<module>   s   