packages feed

HROOT-core-0.9: src/HROOT/Core/TNamed/Interface.hs

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

class ITObject a => ITNamed a where
        setName :: Castable c0 CString => a -> c0 -> IO ()
        
        setNameTitle ::
                       (Castable c1 CString, Castable c0 CString) =>
                       a -> c0 -> c1 -> IO ()
        
        setTitle :: Castable c0 CString => a -> c0 -> IO ()

upcastTNamed :: forall a . (FPtr a, ITNamed a) => a -> TNamed
upcastTNamed h
  = let fh = get_fptr h
        fh2 :: Ptr RawTNamed = castPtr fh
      in cast_fptr_to_obj fh2

downcastTNamed :: forall a . (FPtr a, ITNamed a) => TNamed -> a
downcastTNamed h
  = let fh = get_fptr h
        fh2 = castPtr fh
      in cast_fptr_to_obj fh2