{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module HROOT.Hist.TH1C.Interface where import Data.Word import Data.Int import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import HROOT.Hist.TH1C.RawType import HROOT.Hist.TH1.Interface import HROOT.Core.TArrayC.Interface class (ITH1 a, ITArrayC a) => ITH1C a where upcastTH1C :: forall a . (FPtr a, ITH1C a) => a -> TH1C upcastTH1C :: forall a. (FPtr a, ITH1C a) => a -> TH1C upcastTH1C a h = let fh :: Ptr (Raw a) fh = a -> Ptr (Raw a) forall a. FPtr a => a -> Ptr (Raw a) get_fptr a h Ptr RawTH1C fh2 :: Ptr RawTH1C = Ptr (Raw a) -> Ptr RawTH1C forall a b. Ptr a -> Ptr b castPtr Ptr (Raw a) fh in Ptr (Raw TH1C) -> TH1C forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw TH1C) Ptr RawTH1C fh2 downcastTH1C :: forall a . (FPtr a, ITH1C a) => TH1C -> a downcastTH1C :: forall a. (FPtr a, ITH1C a) => TH1C -> a downcastTH1C TH1C h = let fh :: Ptr (Raw TH1C) fh = TH1C -> Ptr (Raw TH1C) forall a. FPtr a => a -> Ptr (Raw a) get_fptr TH1C h fh2 :: Ptr (Raw a) fh2 = Ptr RawTH1C -> Ptr (Raw a) forall a b. Ptr a -> Ptr b castPtr Ptr (Raw TH1C) Ptr RawTH1C fh in Ptr (Raw a) -> a forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw a) fh2