Method | Description | |
---|---|---|
Create ( string name, string group ) : Axiom.Core.Resource |
Creates a new blank resource, but does not immediately load it. Resource managers handle disparate types of resources. This method returns a pointer to a valid new instance of the kind of resource managed here. The caller should complete the details of the returned resource and call ResourceManager.Load to load the resource. Note that it is the CALLERS responsibility to destroy this object when it is no longer required (after calling ResourceManager.Unload if it had been loaded). If you want to get at the detailed interface of this resource, you'll have to cast the result to the subclass you know you're creating. |
|
Create ( string name, string group, NameValuePairList createParams ) : Axiom.Core.Resource | ||
Create ( string name, string group, bool isManual, IManualResourceLoader loader, NameValuePairList createParams ) : Axiom.Core.Resource | ||
CreateOrRetrieve ( string name, string group ) : Tuple |
||
CreateOrRetrieve ( string name, string group, bool isManual, IManualResourceLoader loader, NameValuePairList paramaters ) : Tuple |
||
GetByHandle ( System.UInt64 handle ) : Axiom.Core.Resource | ||
GetByName ( string name ) : Axiom.Core.Resource | ||
Load ( string name, string group ) : Axiom.Core.Resource |
Generic load method, used to create a Resource specific to this ResourceManager without using one of the specialised 'load' methods (containing per-Resource-type parameters).
|
|
Load ( string name, string group, NameValuePairList loadParams ) : Axiom.Core.Resource | ||
Load ( string name, string group, bool isManual, IManualResourceLoader loader, NameValuePairList loadParams ) : Axiom.Core.Resource | ||
NotifyResourceLoaded ( Axiom.Core.Resource res ) : void |
Notify this manager that a resource which it manages has been loaded.
|
|
NotifyResourceTouched ( Axiom.Core.Resource res ) : void |
Notify this manager that a resource which it manages has been 'touched', ie used.
|
|
NotifyResourceUnloaded ( Axiom.Core.Resource res ) : void |
Notify this manager that a resource which it manages has been unloaded.
|
|
ParseScript ( Stream stream, string groupName, string fileName ) : void |
Parse a script file.
|
|
ReloadAll ( ) : void |
Causes all currently loaded resources to be reloaded. Unloaded resources are not removed, they simply free up their memory as much as they can and wait to be reloaded. |
|
Remove ( Axiom.Core.Resource resource ) : void |
Remove a single resource. Removes a single resource, meaning it will be removed from the list of valid resources in this manager, also causing it to be unloaded. |
|
Remove ( System.UInt64 handle ) : void | ||
Remove ( string name ) : void | ||
RemoveAll ( ) : void |
Removes all resources. Removes all resources, meaning they will be removed from the list of valid resources in this manager, also causing them to be unloaded. |
|
ResourceExists ( System.UInt64 handle ) : bool |
Returns whether a resource with the given handle exists in this manager
|
|
ResourceExists ( string name ) : bool |
Returns whether the named resource exists in this manager
|
|
Unload ( Resource resource ) : void |
Unloads a Resource from the managed resources list, calling it's Unload() method. This method removes a resource from the list maintained by this manager, and unloads it from memory. It does NOT destroy the resource itself, although the memory used by it will be largely freed up. This would allow you to reload the resource again if you wished. |
|
Unload ( System.UInt64 handle ) : void | ||
Unload ( string name ) : void |
Unloads a single resource by name. Unloaded resources are not removed, they simply free up their memory as much as they can and wait to be reloaded. |
|
UnloadAll ( ) : void |
Unloads all resources. Unloaded resources are not removed, they simply free up their memory as much as they can and wait to be reloaded. |
|
this ( System.UInt64 handle ) : Resource |
Gets a resource with the given handle.
|
|
this ( string name ) : Resource |
Gets a reference to the specified named resource.
|
Method | Description | |
---|---|---|
ResourceManager ( ) : System |
Default constructor
|
|
_add ( Resource res ) : void |
Add a newly created resource to the manager
|
|
_create ( string name, System.UInt64 handle, string group, bool isManual, IManualResourceLoader loader, NameValuePairList createParams ) : Resource |
Create a new resource instance compatible with this manager (no custom parameters are populated at this point).
|
|
_remove ( Resource res ) : void |
Remove a resource from this manager; remove it from the lists.
|
|
checkUsage ( ) : void |
Makes sure we are still within budget.
|
|
dispose ( bool disposeManagedResources ) : void |
Class level dispose method When implementing this method in an inherited class the following template should be used; protected override void dispose( bool disposeManagedResources ) { if ( !isDisposed ) { if ( disposeManagedResources ) { // Dispose managed resources. } // There are no unmanaged resources to release, but // if we add them, they need to be released here. } // If it is available, make the call to the // base class's Dispose(Boolean) method base.dispose( disposeManagedResources ); } |
public Create ( string name, string group ) : Axiom.Core.Resource | ||
name | string | The unique name of the resource |
group | string | |
return | Axiom.Core.Resource |
public Create ( string name, string group, NameValuePairList createParams ) : Axiom.Core.Resource | ||
name | string | |
group | string | |
createParams | NameValuePairList | If any parameters are required to create an instance, they should be supplied here as name / value pairs |
return | Axiom.Core.Resource |
public Create ( string name, string group, bool isManual, IManualResourceLoader loader, NameValuePairList createParams ) : Axiom.Core.Resource | ||
name | string | |
group | string | |
isManual | bool | /// Is this resource manually loaded? If so, you should really /// populate the loader parameter in order that the load process /// can call the loader back when loading is required. /// |
loader | IManualResourceLoader | /// Pointer to a ManualLoader implementation which will be called /// when the Resource wishes to load (should be supplied if you set /// isManual to true). You can in fact leave this parameter null /// if you wish, but the Resource will never be able to reload if /// anything ever causes it to unload. Therefore provision of a proper /// ManualLoader instance is strongly recommended. /// |
createParams | NameValuePairList | If any parameters are required to create an instance, they should be supplied here as name / value pairs |
return | Axiom.Core.Resource |
public CreateOrRetrieve ( string name, string group ) : Tuple |
||
name | string | |
group | string | |
return | Tuple |
public CreateOrRetrieve ( string name, string group, bool isManual, IManualResourceLoader loader, NameValuePairList paramaters ) : Tuple |
||
name | string | |
group | string | |
isManual | bool | |
loader | IManualResourceLoader | |
paramaters | NameValuePairList | |
return | Tuple |
public GetByHandle ( System.UInt64 handle ) : Axiom.Core.Resource | ||
handle | System.UInt64 | |
return | Axiom.Core.Resource |
public GetByName ( string name ) : Axiom.Core.Resource | ||
name | string | |
return | Axiom.Core.Resource |
public Load ( string name, string group ) : Axiom.Core.Resource | ||
name | string | The name of the Resource |
group | string | The resource group to which this resource will belong |
return | Axiom.Core.Resource |
public Load ( string name, string group, NameValuePairList loadParams ) : Axiom.Core.Resource | ||
name | string | The name of the Resource |
group | string | The resource group to which this resource will belong |
loadParams | NameValuePairList | /// Optional pointer to a list of name/value pairs /// containing loading parameters for this type of resource. /// |
return | Axiom.Core.Resource |
public Load ( string name, string group, bool isManual, IManualResourceLoader loader, NameValuePairList loadParams ) : Axiom.Core.Resource | ||
name | string | The name of the Resource |
group | string | The resource group to which this resource will belong |
isManual | bool | /// Is the resource to be manually loaded? If so, you should /// provide a value for the loader parameter /// |
loader | IManualResourceLoader | /// The manual loader which is to perform the required actions /// when this resource is loaded; only applicable when you specify true /// for the previous parameter /// |
loadParams | NameValuePairList | /// Optional pointer to a list of name/value pairs /// containing loading parameters for this type of resource. /// |
return | Axiom.Core.Resource |
public NotifyResourceLoaded ( Axiom.Core.Resource res ) : void | ||
res | Axiom.Core.Resource | the resource |
return | void |
public NotifyResourceTouched ( Axiom.Core.Resource res ) : void | ||
res | Axiom.Core.Resource | the resource |
return | void |
public NotifyResourceUnloaded ( Axiom.Core.Resource res ) : void | ||
res | Axiom.Core.Resource | the resource |
return | void |
public ParseScript ( Stream stream, string groupName, string fileName ) : void | ||
stream | Stream | reference to a data stream which is the source of the script |
groupName | string | /// The name of a resource group which should be used if any resources /// are created during the parse of this script. /// |
fileName | string | |
return | void |
public Remove ( Axiom.Core.Resource resource ) : void | ||
resource | Axiom.Core.Resource | The resource to remove |
return | void |
public Remove ( System.UInt64 handle ) : void | ||
handle | System.UInt64 | The Handle of the resource to remove |
return | void |
public Remove ( string name ) : void | ||
name | string | The name of the resource to remove |
return | void |
public ResourceExists ( System.UInt64 handle ) : bool | ||
handle | System.UInt64 | handle of the resource |
return | bool |
public ResourceExists ( string name ) : bool | ||
name | string | name of the resource |
return | bool |
public Unload ( System.UInt64 handle ) : void | ||
handle | System.UInt64 | Handle of the resource |
return | void |
public Unload ( string name ) : void | ||
name | string | Name of the resource. |
return | void |
protected abstract _create ( string name, System.UInt64 handle, string group, bool isManual, IManualResourceLoader loader, NameValuePairList createParams ) : Resource | ||
name | string | The unique name of the resource |
handle | System.UInt64 | |
group | string | The name of the resource group to attach this new resource to |
isManual | bool | /// Is this resource manually loaded? If so, you should really /// populate the loader parameter in order that the load process /// can call the loader back when loading is required. /// |
loader | IManualResourceLoader | /// A ManualLoader implementation which will be called /// when the Resource wishes to load (should be supplied if you set /// isManual to true). You can in fact leave this parameter null /// if you wish, but the Resource will never be able to reload if /// anything ever causes it to unload. Therefore provision of a proper /// ManualLoader instance is strongly recommended. /// |
createParams | NameValuePairList | /// If any parameters are required to create an instance, /// they should be supplied here as name / value pairs. These do not need /// to be set on the instance (handled elsewhere), just used if required /// to differentiate which concrete class is created. /// |
return | Resource |
protected dispose ( bool disposeManagedResources ) : void | ||
disposeManagedResources | bool | True if Unmanaged resources should be released. |
return | void |
public this ( System.UInt64 handle ) : Resource | ||
handle | System.UInt64 | Handle of the resource to retrieve. |
return | Resource |
public this ( string name ) : Resource | ||
name | string | Name of the resource to retrieve. |
return | Resource |