{-# LANGUAGE EmptyDataDecls, ExistentialQuantification,
  FlexibleContexts, FlexibleInstances, ForeignFunctionInterface,
  MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies,
  TypeSynonymInstances #-}
module HROOT.Core.TCollection.Interface where
import Data.Word
import Data.Int
import Foreign.C
import Foreign.Ptr
import FFICXX.Runtime.Cast
import HROOT.Core.TCollection.RawType
import HROOT.Core.TObject.Interface

class (ITObject a) => ITCollection a where

upcastTCollection ::
                  forall a . (FPtr a, ITCollection a) => a -> TCollection
upcastTCollection :: forall a. (FPtr a, ITCollection a) => a -> TCollection
upcastTCollection a
h
  = let fh :: Ptr (Raw a)
fh = a -> Ptr (Raw a)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr a
h
        Ptr RawTCollection
fh2 :: Ptr RawTCollection = Ptr (Raw a) -> Ptr RawTCollection
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw TCollection) -> TCollection
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw TCollection)
Ptr RawTCollection
fh2

downcastTCollection ::
                    forall a . (FPtr a, ITCollection a) => TCollection -> a
downcastTCollection :: forall a. (FPtr a, ITCollection a) => TCollection -> a
downcastTCollection TCollection
h
  = let fh :: Ptr (Raw TCollection)
fh = TCollection -> Ptr (Raw TCollection)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr TCollection
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawTCollection -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw TCollection)
Ptr RawTCollection
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2