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

-- module HROOT.Class.Interface where

module HROOT.Class.TH2F.Interface where


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

import HROOT.Class.TH2F.RawType

import HROOT.Class.TH2.Interface
import HROOT.Class.TArrayF.Interface


class (ITH2 a,ITArrayF a) => ITH2F a where

instance Existable TH2F where
  data Exist TH2F = forall a. (FPtr a, ITH2F a) => ETH2F a

upcastTH2F :: (FPtr a, ITH2F a) => a -> TH2F
upcastTH2F h = let fh = get_fptr h
                   fh2 :: ForeignPtr RawTH2F = castForeignPtr fh
               in cast_fptr_to_obj fh2