{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module HROOT.Core.TGlobal.Interface where import Data.Word import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import HROOT.Core.TGlobal.RawType import HROOT.Core.TDictionary.Interface class ITDictionary a => ITGlobal a upcastTGlobal :: forall a . (FPtr a, ITGlobal a) => a -> TGlobal upcastTGlobal h = let fh = get_fptr h fh2 :: Ptr RawTGlobal = castPtr fh in cast_fptr_to_obj fh2 downcastTGlobal :: forall a . (FPtr a, ITGlobal a) => TGlobal -> a downcastTGlobal h = let fh = get_fptr h fh2 = castPtr fh in cast_fptr_to_obj fh2