Dali 3D User Interface Engine
List of all members | Public Member Functions | Public Attributes
Dali::Internal::Platform::ResourceCollector Class Reference

Used for platform testing to record the result of resource requests initiated by tests. More...

#include <resource-collector.h>

Inheritance diagram for Dali::Internal::Platform::ResourceCollector:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::Platform::ResourceCollector:
Collaboration graph
[legend]

Public Member Functions

 ResourceCollector ()
 
virtual ~ResourceCollector ()
 
virtual void LoadResponse (Dali::Integration::ResourceId id, Dali::Integration::ResourceTypeId type, Dali::Integration::ResourcePointer resource, Dali::Integration::LoadStatus status)
 Provide the results of a resource loading operation to the cache. More...
 
virtual void LoadFailed (Dali::Integration::ResourceId id, Dali::Integration::ResourceFailure failure)
 Report that a resource loading operation has failed. More...
 

Public Attributes

ResourceStatusMap mCompletionStatuses
 Record of the status of each completed resource. More...
 
ResourceCounterMap mCompletionCounts
 Record of how many times each resource completed (every value should be 1, else we are broken). More...
 
ResourceCounterMap mSuccessCounts
 Record of how many times each resource succeeded (every value should be 0 or 1, else we are broken). More...
 
ResourceCounterMap mFailureCounts
 Record of how many times each resource failed (every value should be 0 or 1, else we are broken). More...
 
ResourceSequence mCompletionSequence
 Remember the order of request completions so request priority can be tested. More...
 
unsigned mGrandTotalCompletions
 Count of all successes and failures. More...
 
unsigned mGrandTotalNotifications
 Count of all successes, failures, loading notifications and partially loaded notifications. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dali::Integration::ResourceCache
virtual ~ResourceCache ()
 Virtual protected destructor, no deletion through this interface. More...
 

Detailed Description

Used for platform testing to record the result of resource requests initiated by tests.

Definition at line 49 of file resource-collector.h.

Constructor & Destructor Documentation

Dali::Internal::Platform::ResourceCollector::ResourceCollector ( )

Definition at line 31 of file resource-collector.cpp.

Dali::Internal::Platform::ResourceCollector::~ResourceCollector ( )
virtual

Definition at line 37 of file resource-collector.cpp.

Member Function Documentation

void Dali::Internal::Platform::ResourceCollector::LoadFailed ( Dali::Integration::ResourceId  id,
Dali::Integration::ResourceFailure  failure 
)
virtual

Report that a resource loading operation has failed.

Parameters
[in]idThe unique ID of the load request. This should match an ID previously passed into PlatformAbstraction::LoadResource().
[in]failureAn error code, used to determine why the load failed.

Implements Dali::Integration::ResourceCache.

Definition at line 53 of file resource-collector.cpp.

References mCompletionSequence, mCompletionStatuses, mFailureCounts, mGrandTotalCompletions, and mGrandTotalNotifications.

void Dali::Internal::Platform::ResourceCollector::LoadResponse ( Dali::Integration::ResourceId  id,
Dali::Integration::ResourceTypeId  type,
Dali::Integration::ResourcePointer  resource,
Dali::Integration::LoadStatus  status 
)
virtual

Provide the results of a resource loading operation to the cache.

Parameters
[in]idThe unique ID of the load request. This should match an ID previously passed into PlatformAbstraction::LoadResource(). LoadResponse() may be called multiple times with the same ID, when results are available at different stages e.g. a thumbnail image may be provided, before the full image is loaded.
[in]typeThe type of the resource.
[in]resourceA pointer to a resource (Bitmap etc).
[in]statusThe current loading status. RESOURCE_LOADING and RESOURCE_PARTIALLY_LOADED indicate there are more responses to come, RESOURCE_COMPLETELY_LOADED indicates this is the last response for this id.

Implements Dali::Integration::ResourceCache.

Definition at line 39 of file resource-collector.cpp.

References DALI_ASSERT_DEBUG, mCompletionCounts, mCompletionSequence, mCompletionStatuses, mGrandTotalCompletions, mGrandTotalNotifications, mSuccessCounts, and Dali::Integration::RESOURCE_COMPLETELY_LOADED.

Member Data Documentation

ResourceCounterMap Dali::Internal::Platform::ResourceCollector::mCompletionCounts

Record of how many times each resource completed (every value should be 1, else we are broken).

Definition at line 65 of file resource-collector.h.

Referenced by LoadResponse().

ResourceSequence Dali::Internal::Platform::ResourceCollector::mCompletionSequence

Remember the order of request completions so request priority can be tested.

Definition at line 75 of file resource-collector.h.

Referenced by LoadFailed(), and LoadResponse().

ResourceStatusMap Dali::Internal::Platform::ResourceCollector::mCompletionStatuses

Record of the status of each completed resource.

Definition at line 62 of file resource-collector.h.

Referenced by LoadFailed(), LoadResponse(), and UtcDaliCancelSomeLoads().

ResourceCounterMap Dali::Internal::Platform::ResourceCollector::mFailureCounts

Record of how many times each resource failed (every value should be 0 or 1, else we are broken).

Only resource IDs that correspond to deliberately unloadable resources should have counts other than 0.

Definition at line 73 of file resource-collector.h.

Referenced by LoadFailed(), UtcDaliCancelAllLoads(), UtcDaliCancelSomeLoads(), and UtcDaliLoadCompletion().

unsigned Dali::Internal::Platform::ResourceCollector::mGrandTotalCompletions

Count of all successes and failures.

Definition at line 77 of file resource-collector.h.

Referenced by LoadFailed(), LoadResponse(), UtcDaliCancelAllLoads(), UtcDaliCancelSomeLoads(), and UtcDaliLoadCompletion().

unsigned Dali::Internal::Platform::ResourceCollector::mGrandTotalNotifications

Count of all successes, failures, loading notifications and partially loaded notifications.

Definition at line 79 of file resource-collector.h.

Referenced by LoadFailed(), LoadResponse(), Dali::Internal::Platform::PollForNotification(), UtcDaliCancelAllLoads(), and UtcDaliCancelSomeLoads().

ResourceCounterMap Dali::Internal::Platform::ResourceCollector::mSuccessCounts

Record of how many times each resource succeeded (every value should be 0 or 1, else we are broken).

Definition at line 68 of file resource-collector.h.

Referenced by LoadResponse(), UtcDaliCancelAllLoads(), UtcDaliCancelSomeLoads(), and UtcDaliLoadCompletion().


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali