HROOT-core-0.10.0.1: src/HROOT/Core/TKey/Interface.hs
{-# LANGUAGE EmptyDataDecls, ExistentialQuantification,
FlexibleContexts, FlexibleInstances, ForeignFunctionInterface,
MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies,
TypeSynonymInstances #-}
module HROOT.Core.TKey.Interface where
import Data.Word
import Data.Int
import Foreign.C
import Foreign.Ptr
import FFICXX.Runtime.Cast
import HROOT.Core.TKey.RawType
import HROOT.Core.TNamed.Interface
class (ITNamed a) => ITKey a where
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