173 : mCreator(0), mHandle(0), mLoadingState(LOADSTATE_UNLOADED),
174 mIsBackgroundLoaded(false), mSize(0), mIsManual(0), mLoader(0)
214 virtual void loadImpl(
void) = 0;
218 virtual void unloadImpl(
void) = 0;
259 virtual void prepare(
bool backgroundThread =
false);
271 virtual void load(
bool backgroundThread =
false);
278 virtual void reload(
void);
284 return !mIsManual || mLoader;
297 virtual void unload(
void);
308 virtual void touch(
void);
327 return (mLoadingState.
get() == LOADSTATE_PREPARED);
335 return (mLoadingState.
get() == LOADSTATE_LOADED);
343 return (mLoadingState.
get() == LOADSTATE_LOADING);
350 return mLoadingState.
get();
386 virtual void escalateLoading();
391 virtual void addListener(
Listener* lis);
396 virtual void removeListener(
Listener* lis);
408 virtual void changeGroupOwnership(
const String& newGroup);
436 virtual void _dirtyState();
447 virtual void _fireLoadingComplete(
bool wasBackgroundLoaded);
457 virtual void _firePreparingComplete(
bool wasBackgroundLoaded);
466 virtual void _fireUnloadingComplete(
void);
469 virtual size_t calculateSize(
void)
const;
532 virtual void loadResource(
Resource* resource) = 0;
AtomicScalar< LoadingState > mLoadingState
Is the resource currently loaded?
virtual void preparingComplete(Resource *)
Called whenever the resource finishes preparing (paging into memory).
ManualResourceLoader * mLoader
Optional manual loader; if provided, data is loaded from here instead of a file.
virtual const String & getOrigin(void) const
Get the origin of this resource, e.g.
virtual size_t getSize(void) const
Retrieves info about the size of the resource.
ListenerList mListenerList
SharedPtr< Resource > ResourcePtr
Shared pointer to a Resource.
size_t mStateCount
State count, the number of times this resource has changed state.
ResourceHandle mHandle
Numeric handle for more efficient look up than name.
virtual bool isBackgroundLoaded(void) const
Returns whether this Resource has been earmarked for background loading.
virtual size_t getStateCount() const
Returns the number of times this resource has changed state, which generally means the number of time...
Abstract class representing a loadable resource (e.g.
Interface describing a manual resource loader.
virtual void prepareResource(Resource *resource)
Called when a resource wishes to load.
unsigned long long int ResourceHandle
virtual bool isLoading() const
Returns whether the resource is currently in the process of background loading.
bool mIsManual
Is this file manually loaded?
String mGroup
The name of the resource group.
virtual bool isManuallyLoaded(void) const
Is this resource manually loaded?
virtual void prepareImpl(void)
Internal implementation of the meat of the 'prepare' action.
virtual bool isReloadable(void) const
Returns true if the Resource is reloadable, false otherwise.
virtual void postLoadImpl(void)
Internal hook to perform actions after the load process, but before the resource has been marked as f...
String mName
Unique name of the resource.
virtual const String & getGroup(void) const
Gets the group which this resource is a member of.
virtual bool isPrepared(void) const
Returns true if the Resource has been prepared, false otherwise.
Resource()
Protected unnamed constructor to prevent default construction.
virtual void unloadingComplete(Resource *)
Called whenever the resource has been unloaded.
virtual const String & getName(void) const
Gets resource name.
Class defining the common interface which classes can use to present a reflection-style, self-defining parameter set to callers.
virtual OGRE_DEPRECATED void backgroundLoadingComplete(Resource *)
Callback to indicate that background loading has completed.
size_t mSize
The size of the resource in bytes.
virtual ~ManualResourceLoader()
virtual void setBackgroundLoaded(bool bl)
Tells the resource whether it is background loaded or not.
volatile bool mIsBackgroundLoaded
Is this resource going to be background loaded? Only applicable for multithreaded.
virtual void preUnloadImpl(void)
Internal hook to perform actions before the unload process.
virtual OGRE_DEPRECATED void backgroundPreparingComplete(Resource *)
Callback to indicate that background preparing has completed.
Defines a generic resource handler.
ResourceManager * mCreator
Creator.
virtual void preLoadImpl(void)
Internal hook to perform actions before the load process, but after the resource has been marked as '...
virtual bool isLoaded(void) const
Returns true if the Resource has been loaded, false otherwise.
virtual ResourceManager * getCreator(void)
Gets the manager which created this resource.
virtual void unprepareImpl(void)
Internal function for undoing the 'prepare' action.
virtual ResourceHandle getHandle(void) const
LoadingState
Enum identifying the loading state of the resource.
String mOrigin
Origin of this resource (e.g. script name) - optional.
virtual void _notifyOrigin(const String &origin)
Notify this resource of it's origin.
virtual void postUnloadImpl(void)
Internal hook to perform actions after the unload process, but before the resource has been marked as...
set< Listener * >::type ListenerList
virtual LoadingState getLoadingState() const
Returns the current loading state.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
virtual void loadingComplete(Resource *)
Called whenever the resource finishes loading.