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

class (IDeletable a) => IOGRFeature a where

upcastOGRFeature ::
                 forall a . (FPtr a, IOGRFeature a) => a -> OGRFeature
upcastOGRFeature :: forall a. (FPtr a, IOGRFeature a) => a -> OGRFeature
upcastOGRFeature a
h
  = let fh :: Ptr (Raw a)
fh = a -> Ptr (Raw a)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr a
h
        Ptr RawOGRFeature
fh2 :: Ptr RawOGRFeature = Ptr (Raw a) -> Ptr RawOGRFeature
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw OGRFeature) -> OGRFeature
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw OGRFeature)
Ptr RawOGRFeature
fh2

downcastOGRFeature ::
                   forall a . (FPtr a, IOGRFeature a) => OGRFeature -> a
downcastOGRFeature :: forall a. (FPtr a, IOGRFeature a) => OGRFeature -> a
downcastOGRFeature OGRFeature
h
  = let fh :: Ptr (Raw OGRFeature)
fh = OGRFeature -> Ptr (Raw OGRFeature)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr OGRFeature
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawOGRFeature -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw OGRFeature)
Ptr RawOGRFeature
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2