2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "resource-collector.h"
19 #include <dali/integration-api/debug.h>
27 using namespace Dali::Integration;
29 ResourceCollector::ResourceCollector() :
30 mGrandTotalCompletions(0)
34 ResourceCollector::~ResourceCollector() {}
36 void ResourceCollector::LoadResponse( Dali::Integration::ResourceId id, Dali::Integration::ResourceTypeId type, Dali::Integration::ResourcePointer resource, Dali::Integration::LoadStatus status )
38 if( status == RESOURCE_COMPLETELY_LOADED )
40 DALI_ASSERT_DEBUG( mCompletionCounts.find(id) == mCompletionCounts.end() && "A resource can only complete once." );
41 mCompletionStatuses[id] = true;
42 ++mCompletionCounts[id];
44 mCompletionSequence.push_back( id );
45 ++mGrandTotalCompletions;
49 void ResourceCollector::LoadFailed( Dali::Integration::ResourceId id, Dali::Integration::ResourceFailure failure )
51 mCompletionStatuses[id] = false;
53 mCompletionSequence.push_back( id );
54 ++mGrandTotalCompletions;
58 } /* namespace Platform */
59 } /* namespace Internal */
60 } /* namespace Dali */