{-# LANGUAGE EmptyDataDecls, ExistentialQuantification,
  FlexibleContexts, FlexibleInstances, ForeignFunctionInterface,
  MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies,
  TypeSynonymInstances #-}
module HROOT.Graf.TCutG.Interface where
import Data.Word
import Data.Int
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 where

upcastTCutG :: forall a . (FPtr a, ITCutG a) => a -> TCutG
upcastTCutG :: forall a. (FPtr a, ITCutG a) => a -> TCutG
upcastTCutG 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 RawTCutG
fh2 :: Ptr RawTCutG = Ptr (Raw a) -> Ptr RawTCutG
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw TCutG) -> TCutG
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw TCutG)
Ptr RawTCutG
fh2

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