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

-- module HROOT.Class.Interface where

module HROOT.Class.TH2C.Interface where


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

import HROOT.Class.TH2C.RawType

import HROOT.Class.TH2.Interface
import HROOT.Class.TArrayC.Interface


class (ITH2 a,ITArrayC a) => ITH2C a where

instance Existable TH2C where
  data Exist TH2C = forall a. (FPtr a, ITH2C a) => ETH2C a

upcastTH2C :: (FPtr a, ITH2C a) => a -> TH2C
upcastTH2C h = let fh = get_fptr h
                   fh2 :: ForeignPtr RawTH2C = castForeignPtr fh
               in cast_fptr_to_obj fh2