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

class (IOGRGeometry a) => IOGRGeometryCollection a where

upcastOGRGeometryCollection ::
                            forall a . (FPtr a, IOGRGeometryCollection a) =>
                              a -> OGRGeometryCollection
upcastOGRGeometryCollection :: forall a.
(FPtr a, IOGRGeometryCollection a) =>
a -> OGRGeometryCollection
upcastOGRGeometryCollection 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 RawOGRGeometryCollection
fh2 :: Ptr RawOGRGeometryCollection = Ptr (Raw a) -> Ptr RawOGRGeometryCollection
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw OGRGeometryCollection) -> OGRGeometryCollection
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw OGRGeometryCollection)
Ptr RawOGRGeometryCollection
fh2

downcastOGRGeometryCollection ::
                              forall a . (FPtr a, IOGRGeometryCollection a) =>
                                OGRGeometryCollection -> a
downcastOGRGeometryCollection :: forall a.
(FPtr a, IOGRGeometryCollection a) =>
OGRGeometryCollection -> a
downcastOGRGeometryCollection OGRGeometryCollection
h
  = let fh :: Ptr (Raw OGRGeometryCollection)
fh = OGRGeometryCollection -> Ptr (Raw OGRGeometryCollection)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr OGRGeometryCollection
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawOGRGeometryCollection -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw OGRGeometryCollection)
Ptr RawOGRGeometryCollection
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2