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

-- module HROOT.Class.Interface where

module HROOT.Class.TEfficiency.Interface where


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

import HROOT.Class.TEfficiency.RawType

import HROOT.Class.TNamed.Interface
import HROOT.Class.TAttLine.Interface
import HROOT.Class.TAttFill.Interface
import HROOT.Class.TAttMarker.Interface


class (ITNamed a,ITAttLine a,ITAttFill a,ITAttMarker a) => ITEfficiency a where

instance Existable TEfficiency where
  data Exist TEfficiency = forall a. (FPtr a, ITEfficiency a) => ETEfficiency a

upcastTEfficiency :: (FPtr a, ITEfficiency a) => a -> TEfficiency
upcastTEfficiency h = let fh = get_fptr h
                          fh2 :: ForeignPtr RawTEfficiency = castForeignPtr fh
                      in cast_fptr_to_obj fh2