+/**
+ * This macro easily registers types to act as resources. It should be
+ * used in a module file in global scope.
+ * \param TYPE The type (class), qualified as needed for the scope.
+ * \param EXT The file extension the resource uses.
+ * \param PREFIX The path prefix where a resource of this type could be.
+ */
+#define MOOF_REGISTER_RESOURCE(TYPE, EXT, PREFIX) \
+namespace { \
+ struct EXT { \
+ EXT() { moof::resource::register_type<TYPE>(#EXT, #PREFIX); } \
+ ~EXT() { moof::resource::unregister_type(#EXT); } \
+ }; \
+ static EXT EXT; \
+}
+