module HROOT.Class.TObjArray.Cast where
import Foreign.Ptr
import Foreign.ForeignPtr
import HROOT.TypeCast
import System.IO.Unsafe
import HROOT.Class.TObjArray.RawType
import HROOT.Class.TObjArray.Interface
instance (ITObjArray a, FPtr a) => Castable a (Ptr RawTObjArray) where
cast = unsafeForeignPtrToPtr . castForeignPtr . get_fptr
uncast = cast_fptr_to_obj . castForeignPtr . unsafePerformIO . newForeignPtr_
instance Castable TObjArray (Ptr RawTObjArray) where
cast = unsafeForeignPtrToPtr . castForeignPtr . get_fptr
uncast = cast_fptr_to_obj . castForeignPtr . unsafePerformIO . newForeignPtr_