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