Corrade/Utility/Resource.h file

Class Corrade::Utility::Resource.

Namespaces

namespace Corrade
Root namespace.
namespace Corrade::Utility
Utilities.

Classes

class Corrade::Utility::Resource
Access to compiled-in resources.

Defines

#define CORRADE_RESOURCE_INITIALIZE(name)
Initialize a resource.
#define CORRADE_RESOURCE_FINALIZE(name)
Finalize a resource.

Define documentation

#define CORRADE_RESOURCE_INITIALIZE(name)

Initialize a resource.

If a resource is compiled into a dynamic library or directly into the executable, it will be registered automatically thanks to the CORRADE_AUTOMATIC_INITIALIZER() macro. However, if the resource is compiled into static library, it must be explicitly initialized via this macro, e.g. at the beginning of main(), otherwise it won't be known to Utility::Resource. You can also wrap these macro calls into another function (which will then be compiled into a dynamic library or the main executable) and use the CORRADE_AUTOMATIC_INITIALIZER() macro for an automatic call:

Functions called by this macro don't do any dynamic allocation or other operations that could fail, so it's safe to call it even in restricted phases of application execution. It's also safe to call this macro more than once.

#define CORRADE_RESOURCE_FINALIZE(name)

Finalize a resource.

De-registers resource previously (even automatically) initialized via CORRADE_RESOURCE_INITIALIZE(). After this call, Utility::Resource will not know about given resource anymore. Useful for example when a resource was a part of a dynamically loaded library (or a plugin) and it needs to be cleaned up after the library got unloaded again.

Functions called by this macro don't do any dynamic allocation or other operations that could fail, so it's safe to call it even in restricted phases of application execution. It's also safe to call this macro more than once.