|
| ResourceServer () |
| constructor
|
|
virtual | ~ResourceServer () |
| destructor
|
|
void | Open () |
| open manager
|
|
void | Close () |
| close manager
|
|
void | Update (IndexT frameIndex) |
| update resource manager, call each frame
|
|
Resources::ResourceId | CreateResource (const ResourceName &res, std::function< void(const Resources::ResourceId)> success=nullptr, std::function< void(const Resources::ResourceId)> failed=nullptr, bool immediate=false, bool stream=true) |
| create a new resource (stream-managed), which will be loaded at some later point, if not already loaded
|
|
Resources::ResourceId | CreateResource (const ResourceName &res, const Util::StringAtom &tag, std::function< void(const Resources::ResourceId)> success=nullptr, std::function< void(const Resources::ResourceId)> failed=nullptr, bool immediate=false, bool stream=true) |
| overload which also takes an identifying tag, which is used to group-discard resources
|
|
template<class METADATA > |
Resources::ResourceId | CreateResource (const ResourceName &res, const METADATA &metaData, std::function< void(const Resources::ResourceId)> success=nullptr, std::function< void(const Resources::ResourceId)> failed=nullptr, bool immediate=false, bool stream=true) |
| create a new resource (stream-managed), which will be loaded at some later point, if not already loaded
|
|
template<class METADATA > |
Resources::ResourceId | CreateResource (const ResourceName &res, const METADATA &metaData, const Util::StringAtom &tag, std::function< void(const Resources::ResourceId)> success=nullptr, std::function< void(const Resources::ResourceId)> failed=nullptr, bool immediate=false, bool stream=true) |
| overload which also takes an identifying tag, which is used to group-discard resources
|
|
void | DiscardResource (const Resources::ResourceId res) |
| discard resource (stream-managed)
|
|
void | DiscardResources (const Util::StringAtom &tag) |
| discard all resources by tag (stream-managed)
|
|
bool | HasPendingResources () |
| returns true if there are pending resources in-flight
|
|
void | ReloadResource (const ResourceName &res, std::function< void(const Resources::ResourceId)> success=nullptr, std::function< void(const Resources::ResourceId)> failed=nullptr) |
| reload resource
|
|
void | SetMinLod (const ResourceId &id, float lod, bool immediate) |
| stream in a new LOD
|
|
void | CreateResourceListener (const ResourceId &id, std::function< void(const Resources::ResourceId)> success, std::function< void(const Resources::ResourceId)> failed=nullptr) |
| Create single-fire listener for resource. When resource is loaded, the callbacks will be invoked and the listener is destroyed.
|
|
Core::Rtti * | GetType (const Resources::ResourceId id) |
| get type of resource pool this resource was allocated with
|
|
const Resources::ResourceName | GetName (const Resources::ResourceId id) const |
| get resource name
|
|
const Util::StringAtom | GetTag (const Resources::ResourceId id) const |
| get tag resource was first registered with
|
|
const Resource::State | GetState (const Resources::ResourceId id) const |
| get resource state
|
|
const SizeT | GetUsage (const Resources::ResourceId id) const |
| get usage
|
|
bool | HasResource (const Resources::ResourceId id) const |
| check if resource id is valid
|
|
const Resources::ResourceId | GetId (const Resources::ResourceName &name) const |
| get id from name
|
|
void | RegisterStreamLoader (const Util::StringAtom &ext, const Core::Rtti &loaderClass) |
| register a stream pool, which takes an extension and the RTTI of the resource type to create
|
|
template<class POOL_TYPE > |
POOL_TYPE * | GetStreamLoader () const |
| get stream pool for later use
|
|
void | WaitForLoaderThread () |
| Wait for all loader threads.
|
|
void | LoadDefaultResources () |
| goes through all pools and sets up their default resources
|
|
| RefCounted () |
| constructor
|
|
int | GetRefCount () const |
| get the current refcount
|
|
void | AddRef () |
| increment refcount by one
|
|
void | Release () |
| decrement refcount and destroy object if refcount is zero
|
|
bool | IsInstanceOf (const Rtti &rtti) const |
| return true if this object is instance of given class
|
|
bool | IsInstanceOf (const Util::String &className) const |
| return true if this object is instance of given class by string
|
|
bool | IsInstanceOf (const Util::FourCC &classFourCC) const |
| return true if this object is instance of given class by fourcc
|
|
bool | IsA (const Rtti &rtti) const |
| return true if this object is instance of given class, or a derived class
|
|
bool | IsA (const Util::String &rttiName) const |
| return true if this object is instance of given class, or a derived class, by string
|
|
bool | IsA (const Util::FourCC &rttiFourCC) const |
| return true if this object is instance of given class, or a derived class, by fourcc
|
|
const Util::String & | GetClassName () const |
| get the class name
|
|
Util::FourCC | GetClassFourCC () const |
| get the class FourCC code
|
|