î
ªÍ X   ã               @   s:   d  d l  m Z d  d l m Z Gd d „  d e ƒ Z d S)é    )Úc_void_p)ÚGEOSExceptionc               @   sI   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  St d |  j j ƒ ‚ d  S)Nz!NULL GEOS %s pointer encountered.)Ú_ptrr   Ú	__class__Ú__name__)Úself© r	   úJ/home/ubuntu/projects/ifolica/build/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   