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

-- module HROOT.Class.Interface where

module HROOT.Class.TNtuple.Interface where


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

import HROOT.Class.TNtuple.RawType

import HROOT.Class.TTree.Interface


class (ITTree a) => ITNtuple a where

instance Existable TNtuple where
  data Exist TNtuple = forall a. (FPtr a, ITNtuple a) => ETNtuple a

upcastTNtuple :: (FPtr a, ITNtuple a) => a -> TNtuple
upcastTNtuple h = let fh = get_fptr h
                      fh2 :: ForeignPtr RawTNtuple = castForeignPtr fh
                  in cast_fptr_to_obj fh2