-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Explicitly handled object names
--   
--   This tiny package contains the class ObjectName, which corresponds to
--   the general notion of explicitly handled identifiers for API objects,
--   e.g. a texture object name in OpenGL or a buffer object name in
--   OpenAL.
@package ObjectName
@version 1.1.0.2

-- | Object names are explicitly handled identifiers for API objects, e.g.
--   a texture object name in OpenGL or a buffer object name in OpenAL.
--   They come in two flavors: If a name can exist on its own without an
--   associated object, we have a GeneratableObjectName, otherwise
--   we have an ObjectName.
module Data.ObjectName

-- | An ObjectName is an explicitly handled identifier for API
--   objects, e.g. a texture object name in OpenGL or a buffer object name
--   in OpenAL.
class ObjectName a

-- | Test if the given object name is currently in use, i.e. test if it has
--   been generated, but not been deleted so far.
isObjectName :: (ObjectName a, MonadIO m) => a -> m Bool

-- | Make the given object name available again, declaring it as unused.
deleteObjectName :: (ObjectName a, MonadIO m) => a -> m ()

-- | Bulk version of deleteObjectName.
deleteObjectNames :: (ObjectName a, MonadIO m) => [a] -> m ()

-- | A GeneratableObjectName is an ObjectName which can be
--   generated without creating an associated object at the same time, e.g.
--   an OpenGL buffer object name. Note that e.g. OpenGL program object
--   names do not fall into this category, because you can only create such
--   a name together with a program object itself.
class ObjectName a => GeneratableObjectName a

-- | Generate a new unused object name. By generating the name, it becomes
--   used.
genObjectName :: (GeneratableObjectName a, MonadIO m) => m a

-- | Bulk version of genObjectName.
genObjectNames :: (GeneratableObjectName a, MonadIO m) => Int -> m [a]
