(GCC 6.2) Remove unused functions from automated tests
[platform/core/uifw/dali-core.git] / dali / internal / event / images / image-factory-cache.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/event/images/image-factory-cache.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/internal/event/common/thread-local-storage.h>
24 #include <dali/internal/event/common/stage-impl.h>
25 #include <dali/internal/event/images/image-factory.h>
26
27 // EXTERNAL INCLUDES
28
29
30 using namespace Dali::Internal::ImageFactoryCache;
31
32 namespace Dali
33 {
34
35 namespace Internal
36 {
37
38 namespace ImageFactoryCache
39 {
40   Request::Request( RequestLifetimeObserver& observer,
41                     RequestId reqId,
42                     ResourceId resId,
43                     const std::string& path,
44                     const ImageAttributes* attr )
45   : resourceId( resId ),
46     url( path ),
47     mId( reqId ),
48     mLifetimeObserver( &observer )
49   {
50     if( attr )
51     {
52       attributes = new ImageAttributes( *attr );
53     }
54     else
55     {
56       attributes = NULL;
57     }
58   }
59
60   Request::~Request()
61   {
62     if( Stage::IsInstalled() && mLifetimeObserver )
63     {
64       mLifetimeObserver->RequestDiscarded( *this );
65     }
66     delete attributes;
67   }
68
69   RequestId Request::GetId() const
70   {
71     return mId;
72   }
73
74   void Request::StopLifetimeObservation()
75   {
76     mLifetimeObserver = NULL;
77   }
78
79 } // namespace ImageFactoryCache
80
81 } // namespace Internal
82
83 } // namespace Dali