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

class (IDeletable a) => IHierarchyLayoutModule a where

upcastHierarchyLayoutModule ::
                            forall a . (FPtr a, IHierarchyLayoutModule a) =>
                              a -> HierarchyLayoutModule
upcastHierarchyLayoutModule :: forall a.
(FPtr a, IHierarchyLayoutModule a) =>
a -> HierarchyLayoutModule
upcastHierarchyLayoutModule 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 RawHierarchyLayoutModule
fh2 :: Ptr RawHierarchyLayoutModule = Ptr (Raw a) -> Ptr RawHierarchyLayoutModule
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw HierarchyLayoutModule) -> HierarchyLayoutModule
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw HierarchyLayoutModule)
Ptr RawHierarchyLayoutModule
fh2

downcastHierarchyLayoutModule ::
                              forall a . (FPtr a, IHierarchyLayoutModule a) =>
                                HierarchyLayoutModule -> a
downcastHierarchyLayoutModule :: forall a.
(FPtr a, IHierarchyLayoutModule a) =>
HierarchyLayoutModule -> a
downcastHierarchyLayoutModule HierarchyLayoutModule
h
  = let fh :: Ptr (Raw HierarchyLayoutModule)
fh = HierarchyLayoutModule -> Ptr (Raw HierarchyLayoutModule)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr HierarchyLayoutModule
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawHierarchyLayoutModule -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw HierarchyLayoutModule)
Ptr RawHierarchyLayoutModule
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2