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

class (ITDirectory a) => ITDirectoryFile a where

upcastTDirectoryFile ::
                     forall a . (FPtr a, ITDirectoryFile a) => a -> TDirectoryFile
upcastTDirectoryFile :: forall a. (FPtr a, ITDirectoryFile a) => a -> TDirectoryFile
upcastTDirectoryFile 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 RawTDirectoryFile
fh2 :: Ptr RawTDirectoryFile = Ptr (Raw a) -> Ptr RawTDirectoryFile
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw TDirectoryFile) -> TDirectoryFile
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw TDirectoryFile)
Ptr RawTDirectoryFile
fh2

downcastTDirectoryFile ::
                       forall a . (FPtr a, ITDirectoryFile a) => TDirectoryFile -> a
downcastTDirectoryFile :: forall a. (FPtr a, ITDirectoryFile a) => TDirectoryFile -> a
downcastTDirectoryFile TDirectoryFile
h
  = let fh :: Ptr (Raw TDirectoryFile)
fh = TDirectoryFile -> Ptr (Raw TDirectoryFile)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr TDirectoryFile
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawTDirectoryFile -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw TDirectoryFile)
Ptr RawTDirectoryFile
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2