![]() |
Murl Engine API
Version 2018.3
|
The IGenericResourceTarget resource object target interface. More...
#include <murl_graph_i_generic_resource_target.h>
The IGenericResourceTarget resource object target interface.
A generic resource target is used to encapsulate (possibly) any number of resource objects, referenced by their unique package/resource ID or directly by pointer. It provides access methods to add, remove or query the set of resource objects that are referenced. By using an IGenericResourceTarget, a graph node's process of handling references to resource objects can be unified, the respective resource object references may be acquired by either specifying a resource ID in an XML scene graph file, or directly set from code when a resource is obtained via a Resource::ICollection from a Logic::IProcessor.
Public Member Functions | |
virtual Bool | Init (IInitTracker *tracker)=0 |
Initialize the resource target. More... | |
virtual Bool | DeInit (IDeInitTracker *tracker)=0 |
De-Initialize the resource target. More... | |
virtual Bool | ConfigChanged (IConfigChangedTracker *tracker, Bool *hasResourceChanged=0)=0 |
Called when the global configuration has changed. More... | |
virtual Bool | Update ()=0 |
Perform an update on the resource target. More... | |
virtual Bool | IsInitialized () const =0 |
Check if the resource target is initialized. More... | |
virtual Bool | IsModified () const =0 |
Check if the resource target is modified. More... | |
virtual Bool | SetInitialized (Bool initialized)=0 |
Manually set or reset the initialized state of the target. More... | |
virtual Bool | SetModified (Bool modified)=0 |
Manually set or reset the modified state of the target. More... | |
virtual UInt32 | GetMinNumberOfResources () const =0 |
Query the minimum number of resource objects. More... | |
virtual UInt32 | GetMaxNumberOfResources () const =0 |
Query the maximum number of resource objects. More... | |
virtual Bool | SetNumberOfResources (UInt32 numberOfResources)=0 |
Set the total number of resources. More... | |
virtual UInt32 | GetNumberOfResources () const =0 |
Get the total number of resources. More... | |
virtual Bool | SetResourceId (const String &resourceId, UInt32 index)=0 |
Set a single resource ID at a given index. More... | |
virtual const String & | GetResourceId (UInt32 index) const =0 |
Get the resource ID at a given index. More... | |
virtual Bool | SetResource (const ObjectType *object, UInt32 index)=0 |
Set (replace) a single resource for referencing at a given position. More... | |
virtual const ObjectType * | GetResource (UInt32 index) const =0 |
Get the resource at a given index. More... | |
|
pure virtual |
Initialize the resource target.
To be able to reference resource objects via their unique IDs in a Resource::ICollection, a Graph::IInitTracker must be passed to the resource target, which holds a reference to the actual collection.
tracker | The tracker used for node initialization. |
|
pure virtual |
De-Initialize the resource target.
tracker | The tracker used for node de-initialization. |
|
pure virtual |
Called when the global configuration has changed.
tracker | The tracker used for change notifications. |
hasResourceChanged | An optional pointer to a Bool value that will be set to true if any of the referenced resources has changed when the global configuration triggered a ConfigChanged event. |
|
pure virtual |
Perform an update on the resource target.
|
pure virtual |
Check if the resource target is initialized.
|
pure virtual |
Check if the resource target is modified.
This method returns true, whenever the set of encapsulated resource references changes, either in size or by content. When modified, that state persists until a manual call to SetModified() with parameter false.
|
pure virtual |
Manually set or reset the initialized state of the target.
initialized | The initialized state. |
|
pure virtual |
Manually set or reset the modified state of the target.
modified | The modified state. |
|
pure virtual |
Query the minimum number of resource objects.
This method returns the defined minimum number of resource object references that must be present for the Init() call to be successful.
|
pure virtual |
Query the maximum number of resource objects.
This method returns the defined maximum number of resource object references that can be present for the Init() call to be successful.
|
pure virtual |
Set the total number of resources.
The given value must be in the range from GetMinNumberOfResources() to GetMaxNumberOfResources().
numberOfResources | The total number of resources in the target. |
|
pure virtual |
Get the total number of resources.
|
pure virtual |
Set a single resource ID at a given index.
You need to make sure that the given index is in the range from 0 to GetNumberOfResources()-1, use SetNumberOfResources() to define the actual node count.
resourceId | A string containing the full package name and ID to a resource object in the resource collection. |
index | The index of the resource ID to set, in the range from 0 to GetNumberOfResources()-1. |
|
pure virtual |
Get the resource ID at a given index.
index | The resource ID index in the range from 0 to GetNumberOfResources()-1. |
|
pure virtual |
Set (replace) a single resource for referencing at a given position.
You need to make sure that the given index is in the range from 0 to GetNumberOfResources()-1, use SetNumberOfResources() to define the actual node count.
object | A pointer to the resource. |
index | The zero-based position where to set the resource, in the range from 0 to GetNumberOfResources()-1. |
|
pure virtual |
Get the resource at a given index.
index | The resource index in the range from 0 to GetNumberOfResources()-1. |