{-# LANGUAGE FlexibleInstances, FlexibleContexts, TypeFamilies, MultiParamTypeClasses, OverlappingInstances, IncoherentInstances #-} module HROOT.Core.TAttAxis.Cast where import Foreign.Ptr import Foreign.ForeignPtr (castForeignPtr, newForeignPtr_) import Foreign.ForeignPtr.Unsafe import FFICXX.Runtime.Cast import System.IO.Unsafe import HROOT.Core.TAttAxis.RawType import HROOT.Core.TAttAxis.Interface instance (ITAttAxis a, FPtr a) => Castable a (Ptr RawTAttAxis) where cast = unsafeForeignPtrToPtr . castForeignPtr . get_fptr uncast = cast_fptr_to_obj . castForeignPtr . unsafePerformIO . newForeignPtr_ instance Castable TAttAxis (Ptr RawTAttAxis) where cast = unsafeForeignPtrToPtr . castForeignPtr . get_fptr uncast = cast_fptr_to_obj . castForeignPtr . unsafePerformIO . newForeignPtr_