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

class (IOGRCurve a) => IOGRSimpleCurve a where

upcastOGRSimpleCurve ::
                     forall a . (FPtr a, IOGRSimpleCurve a) => a -> OGRSimpleCurve
upcastOGRSimpleCurve :: forall a. (FPtr a, IOGRSimpleCurve a) => a -> OGRSimpleCurve
upcastOGRSimpleCurve 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 RawOGRSimpleCurve
fh2 :: Ptr RawOGRSimpleCurve = Ptr (Raw a) -> Ptr RawOGRSimpleCurve
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw OGRSimpleCurve) -> OGRSimpleCurve
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw OGRSimpleCurve)
Ptr RawOGRSimpleCurve
fh2

downcastOGRSimpleCurve ::
                       forall a . (FPtr a, IOGRSimpleCurve a) => OGRSimpleCurve -> a
downcastOGRSimpleCurve :: forall a. (FPtr a, IOGRSimpleCurve a) => OGRSimpleCurve -> a
downcastOGRSimpleCurve OGRSimpleCurve
h
  = let fh :: Ptr (Raw OGRSimpleCurve)
fh = OGRSimpleCurve -> Ptr (Raw OGRSimpleCurve)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr OGRSimpleCurve
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawOGRSimpleCurve -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw OGRSimpleCurve)
Ptr RawOGRSimpleCurve
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2