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

class (IDeletable a) => INodeElement a where

upcastNodeElement ::
                  forall a . (FPtr a, INodeElement a) => a -> NodeElement
upcastNodeElement :: forall a. (FPtr a, INodeElement a) => a -> NodeElement
upcastNodeElement 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 RawNodeElement
fh2 :: Ptr RawNodeElement = Ptr (Raw a) -> Ptr RawNodeElement
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw NodeElement) -> NodeElement
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw NodeElement)
Ptr RawNodeElement
fh2

downcastNodeElement ::
                    forall a . (FPtr a, INodeElement a) => NodeElement -> a
downcastNodeElement :: forall a. (FPtr a, INodeElement a) => NodeElement -> a
downcastNodeElement NodeElement
h
  = let fh :: Ptr (Raw NodeElement)
fh = NodeElement -> Ptr (Raw NodeElement)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr NodeElement
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawNodeElement -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw NodeElement)
Ptr RawNodeElement
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2