{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module OGDF.GraphIO.Interface where import Data.Word import Data.Int import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import OGDF.GraphIO.RawType import STD.Deletable.Interface class (IDeletable a) => IGraphIO a where upcastGraphIO :: forall a . (FPtr a, IGraphIO a) => a -> GraphIO upcastGraphIO :: forall a. (FPtr a, IGraphIO a) => a -> GraphIO upcastGraphIO 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 RawGraphIO fh2 :: Ptr RawGraphIO = Ptr (Raw a) -> Ptr RawGraphIO forall a b. Ptr a -> Ptr b castPtr Ptr (Raw a) fh in Ptr (Raw GraphIO) -> GraphIO forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw GraphIO) Ptr RawGraphIO fh2 downcastGraphIO :: forall a . (FPtr a, IGraphIO a) => GraphIO -> a downcastGraphIO :: forall a. (FPtr a, IGraphIO a) => GraphIO -> a downcastGraphIO GraphIO h = let fh :: Ptr (Raw GraphIO) fh = GraphIO -> Ptr (Raw GraphIO) forall a. FPtr a => a -> Ptr (Raw a) get_fptr GraphIO h fh2 :: Ptr (Raw a) fh2 = Ptr RawGraphIO -> Ptr (Raw a) forall a b. Ptr a -> Ptr b castPtr Ptr (Raw GraphIO) Ptr RawGraphIO fh in Ptr (Raw a) -> a forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw a) fh2