{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module HROOT.Core.TArrayC.Interface where import Data.Word import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import HROOT.Core.TArrayC.RawType import HROOT.Core.TArray.Interface class ITArray a => ITArrayC a upcastTArrayC :: forall a . (FPtr a, ITArrayC a) => a -> TArrayC upcastTArrayC h = let fh = get_fptr h fh2 :: Ptr RawTArrayC = castPtr fh in cast_fptr_to_obj fh2 downcastTArrayC :: forall a . (FPtr a, ITArrayC a) => TArrayC -> a downcastTArrayC h = let fh = get_fptr h fh2 = castPtr fh in cast_fptr_to_obj fh2