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