packages feed

hgdal-1.0.0.0: src/GDAL/OGRFeatureDefn/Interface.hs

{-# LANGUAGE EmptyDataDecls, ExistentialQuantification,
  FlexibleContexts, FlexibleInstances, ForeignFunctionInterface,
  MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies,
  TypeSynonymInstances #-}
module GDAL.OGRFeatureDefn.Interface where
import Data.Word
import Data.Int
import Foreign.C
import Foreign.Ptr
import FFICXX.Runtime.Cast
import GDAL.OGRFeatureDefn.RawType
import GDAL.OGRFieldDefn.RawType
import STD.Deletable.Interface

class (IDeletable a) => IOGRFeatureDefn a where
        getFieldCount :: () => a -> IO CInt
        
        getFieldDefn :: () => a -> CInt -> IO OGRFieldDefn
        
        getGeomFieldCount :: () => a -> IO CInt

upcastOGRFeatureDefn ::
                     forall a . (FPtr a, IOGRFeatureDefn a) => a -> OGRFeatureDefn
upcastOGRFeatureDefn h
  = let fh = get_fptr h
        fh2 :: Ptr RawOGRFeatureDefn = castPtr fh
      in cast_fptr_to_obj fh2

downcastOGRFeatureDefn ::
                       forall a . (FPtr a, IOGRFeatureDefn a) => OGRFeatureDefn -> a
downcastOGRFeatureDefn h
  = let fh = get_fptr h
        fh2 = castPtr fh
      in cast_fptr_to_obj fh2