Removed Resource Saving
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / tizen / resource-loader / resource-loading-client.h
1 #ifndef _DALI_PLATFORM_RESOURCE_LOADING_CLIENT_H_
2 #define _DALI_PLATFORM_RESOURCE_LOADING_CLIENT_H_
3 /*
4  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
5  *
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  *
18  */
19
20 // INTERNAL INCLUDES
21
22 // EXTERNAL INCLUDES
23
24 namespace Dali
25 {
26 namespace TizenPlatform
27 {
28
29 /**
30  * @brief Abstract interface to the caller of a low-level resource loading
31  * function such as a loader for an image format.
32  */
33 class ResourceLoadingClient
34 {
35 public:
36   /**
37    * @brief Check whether the current request has been cancelled.
38    *
39    * This will throw an exception to unwind the stack if the current request
40    * has been cancelled.
41    *
42    * @note Only place calls to this function at exception-safe locations in loader code.
43    **/
44   virtual void InterruptionPoint() const = 0;
45
46 protected:
47   /** Construction is restricted to derived / implementing classes. */
48   ResourceLoadingClient() {}
49   /** Destruction of an object through this interface is not allowed. */
50   ~ResourceLoadingClient() {}
51
52 private:
53   ResourceLoadingClient( const ResourceLoadingClient& rhs );
54   ResourceLoadingClient& operator =( ResourceLoadingClient& rhs );
55 };
56
57 /**
58  * @brief Default implementation of a caller of a low-level resource loading
59  * function which does nothing.
60  */
61 class StubbedResourceLoadingClient : public ResourceLoadingClient
62 {
63 public:
64   /**
65    * @brief Check whether the current request has been cancelled.
66    *
67    * This does nothing and so can never throw an exception.
68    **/
69   virtual void InterruptionPoint() const {}
70
71   /** Construction is a NOP. */
72   StubbedResourceLoadingClient() {}
73   /** Destruction has no work to do. */
74   ~StubbedResourceLoadingClient() {}
75
76 private:
77   StubbedResourceLoadingClient( const StubbedResourceLoadingClient& rhs );
78   StubbedResourceLoadingClient& operator =( StubbedResourceLoadingClient& rhs );
79 };
80
81 } /* namespace TizenPlatform */
82 } /* namespace Dali */
83
84 #endif /* _DALI_PLATFORM_RESOURCE_LOADING_CLIENT_H_ */