packages feed

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

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

class (IDeletable a) => IOGRFieldDefn a where

upcastOGRFieldDefn ::
                   forall a . (FPtr a, IOGRFieldDefn a) => a -> OGRFieldDefn
upcastOGRFieldDefn h
  = let fh = get_fptr h
        fh2 :: Ptr RawOGRFieldDefn = castPtr fh
      in cast_fptr_to_obj fh2

downcastOGRFieldDefn ::
                     forall a . (FPtr a, IOGRFieldDefn a) => OGRFieldDefn -> a
downcastOGRFieldDefn h
  = let fh = get_fptr h
        fh2 = castPtr fh
      in cast_fptr_to_obj fh2