packages feed

HROOT-core-0.10.0.1: src/HROOT/Core/TCollection/Interface.hs

{-# 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 h
  = let fh = get_fptr h
        fh2 :: Ptr RawTCollection = castPtr fh
      in cast_fptr_to_obj fh2

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