ObjectName- Explicitly handled object names

Copyright(c) Sven Panne 2015
MaintainerSven Panne <svenpanne@gmail.com>
Safe HaskellSafe



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.



class ObjectName a where Source

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.

Minimal complete definition

isObjectName, (deleteObjectName | deleteObjectNames)


isObjectName :: MonadIO m => a -> m Bool Source

Test if the given object name is currently in use, i.e. test if it has been generated, but not been deleted so far.

deleteObjectName :: MonadIO m => a -> m () Source

Make the given object name available again, declaring it as unused.

deleteObjectNames :: MonadIO m => [a] -> m () Source

Bulk version of deleteObjectName.

class ObjectName a => GeneratableObjectName a where Source

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.

Minimal complete definition

genObjectName | genObjectNames


genObjectName :: MonadIO m => m a Source

Generate a new unused object name. By generating the name, it becomes used.

genObjectNames :: MonadIO m => Int -> m [a] Source

Bulk version of genObjectName.