packages feed

HROOT-hist-0.9: src/HROOT/Hist/TH2F/Interface.hs

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

class (ITH2 a, ITArrayF a) => ITH2F a

upcastTH2F :: forall a . (FPtr a, ITH2F a) => a -> TH2F
upcastTH2F h
  = let fh = get_fptr h
        fh2 :: Ptr RawTH2F = castPtr fh
      in cast_fptr_to_obj fh2

downcastTH2F :: forall a . (FPtr a, ITH2F a) => TH2F -> a
downcastTH2F h
  = let fh = get_fptr h
        fh2 = castPtr fh
      in cast_fptr_to_obj fh2