packages feed

HROOT-graf-0.9: src/HROOT/Graf/TCutG/Interface.hs

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

class ITGraph a => ITCutG a

upcastTCutG :: forall a . (FPtr a, ITCutG a) => a -> TCutG
upcastTCutG h
  = let fh = get_fptr h
        fh2 :: Ptr RawTCutG = castPtr fh
      in cast_fptr_to_obj fh2

downcastTCutG :: forall a . (FPtr a, ITCutG a) => TCutG -> a
downcastTCutG h
  = let fh = get_fptr h
        fh2 = castPtr fh
      in cast_fptr_to_obj fh2