{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TypeSynonymInstances #-}

module Data.SpirV.Enum.AccessQualifier where

import Data.Word (Word32)
import Foreign.Storable (Storable)

newtype AccessQualifier = AccessQualifier Word32
  deriving newtype (AccessQualifier -> AccessQualifier -> Bool
(AccessQualifier -> AccessQualifier -> Bool)
-> (AccessQualifier -> AccessQualifier -> Bool)
-> Eq AccessQualifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AccessQualifier -> AccessQualifier -> Bool
== :: AccessQualifier -> AccessQualifier -> Bool
$c/= :: AccessQualifier -> AccessQualifier -> Bool
/= :: AccessQualifier -> AccessQualifier -> Bool
Eq, Eq AccessQualifier
Eq AccessQualifier =>
(AccessQualifier -> AccessQualifier -> Ordering)
-> (AccessQualifier -> AccessQualifier -> Bool)
-> (AccessQualifier -> AccessQualifier -> Bool)
-> (AccessQualifier -> AccessQualifier -> Bool)
-> (AccessQualifier -> AccessQualifier -> Bool)
-> (AccessQualifier -> AccessQualifier -> AccessQualifier)
-> (AccessQualifier -> AccessQualifier -> AccessQualifier)
-> Ord AccessQualifier
AccessQualifier -> AccessQualifier -> Bool
AccessQualifier -> AccessQualifier -> Ordering
AccessQualifier -> AccessQualifier -> AccessQualifier
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: AccessQualifier -> AccessQualifier -> Ordering
compare :: AccessQualifier -> AccessQualifier -> Ordering
$c< :: AccessQualifier -> AccessQualifier -> Bool
< :: AccessQualifier -> AccessQualifier -> Bool
$c<= :: AccessQualifier -> AccessQualifier -> Bool
<= :: AccessQualifier -> AccessQualifier -> Bool
$c> :: AccessQualifier -> AccessQualifier -> Bool
> :: AccessQualifier -> AccessQualifier -> Bool
$c>= :: AccessQualifier -> AccessQualifier -> Bool
>= :: AccessQualifier -> AccessQualifier -> Bool
$cmax :: AccessQualifier -> AccessQualifier -> AccessQualifier
max :: AccessQualifier -> AccessQualifier -> AccessQualifier
$cmin :: AccessQualifier -> AccessQualifier -> AccessQualifier
min :: AccessQualifier -> AccessQualifier -> AccessQualifier
Ord, Ptr AccessQualifier -> IO AccessQualifier
Ptr AccessQualifier -> Int -> IO AccessQualifier
Ptr AccessQualifier -> Int -> AccessQualifier -> IO ()
Ptr AccessQualifier -> AccessQualifier -> IO ()
AccessQualifier -> Int
(AccessQualifier -> Int)
-> (AccessQualifier -> Int)
-> (Ptr AccessQualifier -> Int -> IO AccessQualifier)
-> (Ptr AccessQualifier -> Int -> AccessQualifier -> IO ())
-> (forall b. Ptr b -> Int -> IO AccessQualifier)
-> (forall b. Ptr b -> Int -> AccessQualifier -> IO ())
-> (Ptr AccessQualifier -> IO AccessQualifier)
-> (Ptr AccessQualifier -> AccessQualifier -> IO ())
-> Storable AccessQualifier
forall b. Ptr b -> Int -> IO AccessQualifier
forall b. Ptr b -> Int -> AccessQualifier -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: AccessQualifier -> Int
sizeOf :: AccessQualifier -> Int
$calignment :: AccessQualifier -> Int
alignment :: AccessQualifier -> Int
$cpeekElemOff :: Ptr AccessQualifier -> Int -> IO AccessQualifier
peekElemOff :: Ptr AccessQualifier -> Int -> IO AccessQualifier
$cpokeElemOff :: Ptr AccessQualifier -> Int -> AccessQualifier -> IO ()
pokeElemOff :: Ptr AccessQualifier -> Int -> AccessQualifier -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AccessQualifier
peekByteOff :: forall b. Ptr b -> Int -> IO AccessQualifier
$cpokeByteOff :: forall b. Ptr b -> Int -> AccessQualifier -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> AccessQualifier -> IO ()
$cpeek :: Ptr AccessQualifier -> IO AccessQualifier
peek :: Ptr AccessQualifier -> IO AccessQualifier
$cpoke :: Ptr AccessQualifier -> AccessQualifier -> IO ()
poke :: Ptr AccessQualifier -> AccessQualifier -> IO ()
Storable)

instance Show AccessQualifier where
  showsPrec :: Int -> AccessQualifier -> ShowS
showsPrec Int
p (AccessQualifier Word32
v) = case Word32
v of
    Word32
0 -> String -> ShowS
showString String
"ReadOnly"
    Word32
1 -> String -> ShowS
showString String
"WriteOnly"
    Word32
2 -> String -> ShowS
showString String
"ReadWrite"
    Word32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
10) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ String -> ShowS
showString String
"AccessQualifier " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Word32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec (Int
p Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1) Word32
x

pattern ReadOnly :: AccessQualifier
pattern $mReadOnly :: forall {r}. AccessQualifier -> ((# #) -> r) -> ((# #) -> r) -> r
$bReadOnly :: AccessQualifier
ReadOnly = AccessQualifier 0

pattern WriteOnly :: AccessQualifier
pattern $mWriteOnly :: forall {r}. AccessQualifier -> ((# #) -> r) -> ((# #) -> r) -> r
$bWriteOnly :: AccessQualifier
WriteOnly = AccessQualifier 1

pattern ReadWrite :: AccessQualifier
pattern $mReadWrite :: forall {r}. AccessQualifier -> ((# #) -> r) -> ((# #) -> r) -> r
$bReadWrite :: AccessQualifier
ReadWrite = AccessQualifier 2