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

-- module HROOT.Class.Interface where

module HROOT.Class.TTreeSQL.Interface where


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

import HROOT.Class.TTreeSQL.RawType

import HROOT.Class.TTree.Interface


class (ITTree a) => ITTreeSQL a where

instance Existable TTreeSQL where
  data Exist TTreeSQL = forall a. (FPtr a, ITTreeSQL a) => ETTreeSQL a

upcastTTreeSQL :: (FPtr a, ITTreeSQL a) => a -> TTreeSQL
upcastTTreeSQL h = let fh = get_fptr h
                       fh2 :: ForeignPtr RawTTreeSQL = castForeignPtr fh
                   in cast_fptr_to_obj fh2