Corrade/Utility/Resource.h file

Class Corrade::Utility::Resource.

Contents

Namespaces

namespace Corrade
Root namespace.
namespace Corrade::Utility
Utitlities.

Classes

class Corrade::Utility::Resource
Data resource management.

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 exection. 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.

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 exection. It's also safe to call this macro more than once.