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

class (IDeletable a, IHierarchyLayoutModule a) =>
      IFastSimpleHierarchyLayout a where

upcastFastSimpleHierarchyLayout ::
                                forall a . (FPtr a, IFastSimpleHierarchyLayout a) =>
                                  a -> FastSimpleHierarchyLayout
upcastFastSimpleHierarchyLayout :: forall a.
(FPtr a, IFastSimpleHierarchyLayout a) =>
a -> FastSimpleHierarchyLayout
upcastFastSimpleHierarchyLayout 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 RawFastSimpleHierarchyLayout
fh2 :: Ptr RawFastSimpleHierarchyLayout = Ptr (Raw a) -> Ptr RawFastSimpleHierarchyLayout
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw FastSimpleHierarchyLayout) -> FastSimpleHierarchyLayout
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw FastSimpleHierarchyLayout)
Ptr RawFastSimpleHierarchyLayout
fh2

downcastFastSimpleHierarchyLayout ::
                                  forall a . (FPtr a, IFastSimpleHierarchyLayout a) =>
                                    FastSimpleHierarchyLayout -> a
downcastFastSimpleHierarchyLayout :: forall a.
(FPtr a, IFastSimpleHierarchyLayout a) =>
FastSimpleHierarchyLayout -> a
downcastFastSimpleHierarchyLayout FastSimpleHierarchyLayout
h
  = let fh :: Ptr (Raw FastSimpleHierarchyLayout)
fh = FastSimpleHierarchyLayout -> Ptr (Raw FastSimpleHierarchyLayout)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr FastSimpleHierarchyLayout
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawFastSimpleHierarchyLayout -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw FastSimpleHierarchyLayout)
Ptr RawFastSimpleHierarchyLayout
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2