{-# LANGUAGE EmptyDataDecls, ExistentialQuantification,
  FlexibleContexts, FlexibleInstances, ForeignFunctionInterface,
  MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies,
  TypeSynonymInstances #-}
module OGDF.OptimalRanking.Interface where
import Data.Word
import Data.Int
import Foreign.C
import Foreign.Ptr
import FFICXX.Runtime.Cast
import OGDF.OptimalRanking.RawType
import STD.Deletable.Interface
import OGDF.RankingModule.Interface

class (IDeletable a, IRankingModule a) => IOptimalRanking a where

upcastOptimalRanking ::
                     forall a . (FPtr a, IOptimalRanking a) => a -> OptimalRanking
upcastOptimalRanking :: forall a. (FPtr a, IOptimalRanking a) => a -> OptimalRanking
upcastOptimalRanking 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 RawOptimalRanking
fh2 :: Ptr RawOptimalRanking = Ptr (Raw a) -> Ptr RawOptimalRanking
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw OptimalRanking) -> OptimalRanking
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw OptimalRanking)
Ptr RawOptimalRanking
fh2

downcastOptimalRanking ::
                       forall a . (FPtr a, IOptimalRanking a) => OptimalRanking -> a
downcastOptimalRanking :: forall a. (FPtr a, IOptimalRanking a) => OptimalRanking -> a
downcastOptimalRanking OptimalRanking
h
  = let fh :: Ptr (Raw OptimalRanking)
fh = OptimalRanking -> Ptr (Raw OptimalRanking)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr OptimalRanking
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawOptimalRanking -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw OptimalRanking)
Ptr RawOptimalRanking
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2