Murl::Graph::IGenericResourceTarget< ObjectType > Interface Template Referenceabstract

The IGenericResourceTarget resource object target interface. More...

#include "murl_graph_i_generic_resource_target.h"

Inheritance diagram for Murl::Graph::IGenericResourceTarget< ObjectType >:

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=nullptr)=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 StringGetResourceId (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...
 

Detailed Description

template<class ObjectType>
interface Murl::Graph::IGenericResourceTarget< ObjectType >

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.

Member Function Documentation

◆ Init()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::Init ( IInitTracker tracker)
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.

Parameters
trackerThe tracker used for node initialization.
Returns
true if successful.

◆ DeInit()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::DeInit ( IDeInitTracker tracker)
pure virtual

De-Initialize the resource target.

Parameters
trackerThe tracker used for node de-initialization.
Returns
true if successful.

◆ ConfigChanged()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::ConfigChanged ( IConfigChangedTracker tracker,
Bool hasResourceChanged = nullptr 
)
pure virtual

Called when the global configuration has changed.

Parameters
trackerThe tracker used for change notifications.
hasResourceChangedAn 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.
Returns
true if successful.

◆ Update()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::Update ( )
pure virtual

Perform an update on the resource target.

Returns
true if successful.

◆ IsInitialized()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::IsInitialized ( ) const
pure virtual

Check if the resource target is initialized.

Returns
true if initialized.

◆ IsModified()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::IsModified ( ) const
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.

Returns
true if modified.

◆ SetInitialized()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::SetInitialized ( Bool  initialized)
pure virtual

Manually set or reset the initialized state of the target.

Parameters
initializedThe initialized state.
Returns
true if successful.

◆ SetModified()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::SetModified ( Bool  modified)
pure virtual

Manually set or reset the modified state of the target.

Parameters
modifiedThe modified state.
Returns
true if successful.

◆ GetMinNumberOfResources()

template<class ObjectType >
virtual UInt32 Murl::Graph::IGenericResourceTarget< ObjectType >::GetMinNumberOfResources ( ) const
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.

Returns
The required minimum number of resource objects for the target to be valid.

◆ GetMaxNumberOfResources()

template<class ObjectType >
virtual UInt32 Murl::Graph::IGenericResourceTarget< ObjectType >::GetMaxNumberOfResources ( ) const
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.

Returns
The required maximum number of resource objects for the target to be valid.

◆ SetNumberOfResources()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::SetNumberOfResources ( UInt32  numberOfResources)
pure virtual

Set the total number of resources.

The given value must be in the range from GetMinNumberOfResources() to GetMaxNumberOfResources().

Parameters
numberOfResourcesThe total number of resources in the target.
Returns
true if successful.

◆ GetNumberOfResources()

template<class ObjectType >
virtual UInt32 Murl::Graph::IGenericResourceTarget< ObjectType >::GetNumberOfResources ( ) const
pure virtual

Get the total number of resources.

Returns
The total number of resources in the target.

◆ SetResourceId()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::SetResourceId ( const String resourceId,
UInt32  index 
)
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.

Parameters
resourceIdA string containing the full package name and ID to a resource object in the resource collection.
indexThe index of the resource ID to set, in the range from 0 to GetNumberOfResources()-1.
Returns
true if successful.

◆ GetResourceId()

template<class ObjectType >
virtual const String& Murl::Graph::IGenericResourceTarget< ObjectType >::GetResourceId ( UInt32  index) const
pure virtual

Get the resource ID at a given index.

Parameters
indexThe resource ID index in the range from 0 to GetNumberOfResources()-1.
Returns
The total number of resource IDs in the target.

◆ SetResource()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericResourceTarget< ObjectType >::SetResource ( const ObjectType *  object,
UInt32  index 
)
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.

Parameters
objectA pointer to the resource.
indexThe zero-based position where to set the resource, in the range from 0 to GetNumberOfResources()-1.
Returns
true if successful.

◆ GetResource()

template<class ObjectType >
virtual const ObjectType* Murl::Graph::IGenericResourceTarget< ObjectType >::GetResource ( UInt32  index) const
pure virtual

Get the resource at a given index.

Parameters
indexThe resource index in the range from 0 to GetNumberOfResources()-1.
Returns
The resource at the given index.

The documentation for this interface was generated from the following file:
  • murl_graph_i_generic_resource_target.h


Copyright © 2011-2024 Spraylight GmbH.