{-# LANGUAGE ForeignFunctionInterface, TypeFamilies, MultiParamTypeClasses, 
             FlexibleInstances, TypeSynonymInstances, 
             EmptyDataDecls, ExistentialQuantification, ScopedTypeVariables #-}

-- module HROOT.Class.Interface where

module HROOT.Class.TH3C.Interface where


import Data.Word
import Foreign.ForeignPtr
import HROOT.TypeCast

import HROOT.Class.TH3C.RawType

import HROOT.Class.TH3.Interface
import HROOT.Class.TArrayC.Interface


class (ITH3 a,ITArrayC a) => ITH3C a where

instance Existable TH3C where
  data Exist TH3C = forall a. (FPtr a, ITH3C a) => ETH3C a

upcastTH3C :: (FPtr a, ITH3C a) => a -> TH3C
upcastTH3C h = let fh = get_fptr h
                   fh2 :: ForeignPtr RawTH3C = castForeignPtr fh
               in cast_fptr_to_obj fh2