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

class (ITLine a, ITAttFill a) => ITArrow a where

upcastTArrow :: forall a . (FPtr a, ITArrow a) => a -> TArrow
upcastTArrow :: forall a. (FPtr a, ITArrow a) => a -> TArrow
upcastTArrow 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 RawTArrow
fh2 :: Ptr RawTArrow = Ptr (Raw a) -> Ptr RawTArrow
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw TArrow) -> TArrow
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw TArrow)
Ptr RawTArrow
fh2

downcastTArrow :: forall a . (FPtr a, ITArrow a) => TArrow -> a
downcastTArrow :: forall a. (FPtr a, ITArrow a) => TArrow -> a
downcastTArrow TArrow
h
  = let fh :: Ptr (Raw TArrow)
fh = TArrow -> Ptr (Raw TArrow)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr TArrow
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawTArrow -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw TArrow)
Ptr RawTArrow
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2