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

-- module HROOT.Class.Interface where

module HROOT.Class.TCollection.Interface where


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

import HROOT.Class.TCollection.RawType

import HROOT.Class.TObject.Interface


class (ITObject a) => ITCollection a where

instance Existable TCollection where
  data Exist TCollection = forall a. (FPtr a, ITCollection a) => ETCollection a

upcastTCollection :: (FPtr a, ITCollection a) => a -> TCollection
upcastTCollection h = let fh = get_fptr h
                          fh2 :: ForeignPtr RawTCollection = castForeignPtr fh
                      in cast_fptr_to_obj fh2