{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module HROOT.Core.TKey.Interface where import Data.Word import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import HROOT.Core.TKey.RawType import HROOT.Core.TNamed.Interface import {-# SOURCE #-} HROOT.Core.TClass.Interface import {-# SOURCE #-} HROOT.Core.TDirectory.Interface class ITNamed a => ITKey a upcastTKey :: forall a . (FPtr a, ITKey a) => a -> TKey upcastTKey h = let fh = get_fptr h fh2 :: Ptr RawTKey = castPtr fh in cast_fptr_to_obj fh2 downcastTKey :: forall a . (FPtr a, ITKey a) => TKey -> a downcastTKey h = let fh = get_fptr h fh2 = castPtr fh in cast_fptr_to_obj fh2