{-# LANGUAGE EmptyDataDecls, FlexibleInstances,
  MultiParamTypeClasses, TypeFamilies #-}
module OGDF.ListIterator.Template where
import Foreign.C.Types
import Foreign.Ptr
import FFICXX.Runtime.Cast

data RawListIterator tp1

newtype ListIterator tp1 = ListIterator (Ptr (RawListIterator tp1))

class () => IListIterator tp1 where
        deRef :: ListIterator tp1 -> IO tp1
        
        listIteratorPred :: ListIterator tp1 -> IO (ListIterator tp1)
        
        listIteratorSucc :: ListIterator tp1 -> IO (ListIterator tp1)
        
        valid :: ListIterator tp1 -> IO CBool

instance () => FPtr (ListIterator tp1) where
        type Raw (ListIterator tp1) = RawListIterator tp1
        get_fptr :: ListIterator tp1 -> Ptr (Raw (ListIterator tp1))
get_fptr (ListIterator Ptr (RawListIterator tp1)
ptr) = Ptr (Raw (ListIterator tp1))
Ptr (RawListIterator tp1)
ptr
        cast_fptr_to_obj :: Ptr (Raw (ListIterator tp1)) -> ListIterator tp1
cast_fptr_to_obj = Ptr (Raw (ListIterator tp1)) -> ListIterator tp1
Ptr (RawListIterator tp1) -> ListIterator tp1
forall tp1. Ptr (RawListIterator tp1) -> ListIterator tp1
ListIterator

instance () =>
         Castable (ListIterator tp1) (Ptr (RawListIterator tp1))
         where
        cast :: forall r.
ListIterator tp1 -> (Ptr (RawListIterator tp1) -> IO r) -> IO r
cast ListIterator tp1
x Ptr (RawListIterator tp1) -> IO r
f = Ptr (RawListIterator tp1) -> IO r
f (Ptr (RawListIterator tp1) -> Ptr (RawListIterator tp1)
forall a b. Ptr a -> Ptr b
castPtr (ListIterator tp1 -> Ptr (Raw (ListIterator tp1))
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr ListIterator tp1
x))
        uncast :: forall r.
Ptr (RawListIterator tp1) -> (ListIterator tp1 -> IO r) -> IO r
uncast Ptr (RawListIterator tp1)
x ListIterator tp1 -> IO r
f = ListIterator tp1 -> IO r
f (Ptr (Raw (ListIterator tp1)) -> ListIterator tp1
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj (Ptr (RawListIterator tp1) -> Ptr (RawListIterator tp1)
forall a b. Ptr a -> Ptr b
castPtr Ptr (RawListIterator tp1)
x))