packages feed

HROOT-core-0.10.0.1: src/HROOT/Core/TArrayF/Interface.hs

{-# LANGUAGE EmptyDataDecls, ExistentialQuantification,
  FlexibleContexts, FlexibleInstances, ForeignFunctionInterface,
  MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies,
  TypeSynonymInstances #-}
module HROOT.Core.TArrayF.Interface where
import Data.Word
import Data.Int
import Foreign.C
import Foreign.Ptr
import FFICXX.Runtime.Cast
import HROOT.Core.TArrayF.RawType
import HROOT.Core.TArray.Interface

class (ITArray a) => ITArrayF a where

upcastTArrayF :: forall a . (FPtr a, ITArrayF a) => a -> TArrayF
upcastTArrayF h
  = let fh = get_fptr h
        fh2 :: Ptr RawTArrayF = castPtr fh
      in cast_fptr_to_obj fh2

downcastTArrayF :: forall a . (FPtr a, ITArrayF a) => TArrayF -> a
downcastTArrayF h
  = let fh = get_fptr h
        fh2 = castPtr fh
      in cast_fptr_to_obj fh2