1 #ifndef _DALI_PLATFORM_RESOURCE_LOADING_CLIENT_H_
2 #define _DALI_PLATFORM_RESOURCE_LOADING_CLIENT_H_
4 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
26 namespace TizenPlatform
30 * @brief Abstract interface to the caller of a low-level resource loading
31 * function such as a loader for an image format.
33 class ResourceLoadingClient
37 * @brief Check whether the current request has been cancelled.
39 * This will throw an exception to unwind the stack if the current request
42 * @note Only place calls to this function at exception-safe locations in loader code.
44 virtual void InterruptionPoint() const = 0;
47 /** Construction is restricted to derived / implementing classes. */
48 ResourceLoadingClient() {}
49 /** Destruction of an object through this interface is not allowed. */
50 ~ResourceLoadingClient() {}
53 ResourceLoadingClient( const ResourceLoadingClient& rhs );
54 ResourceLoadingClient& operator =( ResourceLoadingClient& rhs );
58 * @brief Default implementation of a caller of a low-level resource loading
59 * function which does nothing.
61 class StubbedResourceLoadingClient : public ResourceLoadingClient
65 * @brief Check whether the current request has been cancelled.
67 * This does nothing and so can never throw an exception.
69 virtual void InterruptionPoint() const {}
71 /** Construction is a NOP. */
72 StubbedResourceLoadingClient() {}
73 /** Destruction has no work to do. */
74 ~StubbedResourceLoadingClient() {}
77 StubbedResourceLoadingClient( const StubbedResourceLoadingClient& rhs );
78 StubbedResourceLoadingClient& operator =( StubbedResourceLoadingClient& rhs );
81 } /* namespace TizenPlatform */
82 } /* namespace Dali */
84 #endif /* _DALI_PLATFORM_RESOURCE_LOADING_CLIENT_H_ */