HROOT-core-0.8: src/HROOT/Core/TArrayL/Interface.hs
{-# LANGUAGE ForeignFunctionInterface, TypeFamilies, MultiParamTypeClasses,
FlexibleInstances, TypeSynonymInstances,
EmptyDataDecls, ExistentialQuantification, ScopedTypeVariables #-}
-- module HROOT.Class.Interface where
module HROOT.Core.TArrayL.Interface where
import Data.Word
import Foreign.C
import Foreign.Ptr
import Foreign.ForeignPtr
import FFICXX.Runtime.Cast
import HROOT.Core.TArrayL.RawType
import HROOT.Core.TArray.Interface
---- ============ ----
class (ITArray a) => ITArrayL a where
instance Existable TArrayL where
data Exist TArrayL = forall a. (FPtr a, ITArrayL a) => ETArrayL a
upcastTArrayL :: (FPtr a, ITArrayL a) => a -> TArrayL
upcastTArrayL h = let fh = get_fptr h
fh2 :: ForeignPtr RawTArrayL = castForeignPtr fh
in cast_fptr_to_obj fh2
downcastTArrayL :: (FPtr a, ITArrayL a) => TArrayL -> a
downcastTArrayL h = let fh = get_fptr h
fh2 = castForeignPtr fh
in cast_fptr_to_obj fh2