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

class (IDeletable a) => IGraph a where

upcastGraph :: forall a . (FPtr a, IGraph a) => a -> Graph
upcastGraph :: forall a. (FPtr a, IGraph a) => a -> Graph
upcastGraph 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 RawGraph
fh2 :: Ptr RawGraph = Ptr (Raw a) -> Ptr RawGraph
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw Graph) -> Graph
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw Graph)
Ptr RawGraph
fh2

downcastGraph :: forall a . (FPtr a, IGraph a) => Graph -> a
downcastGraph :: forall a. (FPtr a, IGraph a) => Graph -> a
downcastGraph Graph
h
  = let fh :: Ptr (Raw Graph)
fh = Graph -> Ptr (Raw Graph)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr Graph
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawGraph -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw Graph)
Ptr RawGraph
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2