Dali 3D User Interface Engine
resource-request.h
Go to the documentation of this file.
1 #ifndef __DALI_INTEGRATION_RESOURCE_REQUEST_H__
2 #define __DALI_INTEGRATION_RESOURCE_REQUEST_H__
3 
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 
21 // INTERNAL INCLUDES
24 
25 namespace Dali
26 {
27 
28 class RefObject;
29 
30 namespace Integration
31 {
32 
33 // Resource Requests
34 
38 typedef IntrusivePtr<Dali::RefObject> ResourcePointer;
39 
44 {
50 };
51 
56 {
57 public:
58 
70  const ResourceType& resourceType,
71  const std::string& resourcePath,
73  : id(newId),
74  type(NULL),
75  path(resourcePath),
76  priority(loadPriority)
77  {
78  type = resourceType.Clone();
79  }
80 
90  const ResourceType& resourceType,
91  const std::string& resourcePath,
92  ResourcePointer resourcePtr,
94  : id(newId),
95  type(NULL),
96  path(resourcePath),
97  resource(resourcePtr),
98  priority(savePriority)
99  {
100  type = resourceType.Clone();
101  }
102 
108  : id(request.id),
109  type(NULL),
110  path(request.path),
111  resource(request.resource),
112  priority(request.priority)
113  {
114  type = request.type->Clone();
115  }
116 
122  {
123  if( this != &rhs )
124  {
125  id = rhs.id;
126  type = rhs.type->Clone();
127  path = rhs.path;
128  resource = rhs.resource;
129  priority = rhs.priority;
130  }
131 
132  return *this;
133  }
134 
139  {
140  delete type;
141  }
142 
148  {
149  return id;
150  }
151 
157  {
158  return type;
159  }
160 
165  const std::string& GetPath() const
166  {
167  return path;
168  }
169 
175  {
176  return resource;
177  }
178 
184  {
185  return priority;
186  }
187 
188 private:
189 
192  std::string path;
197 };
198 
199 } // namespace Integration
200 
201 } // namespace Dali
202 
203 #endif // __DALI_INTEGRATION_RESOURCE_REQUEST_H__
Dali Docs Home
Read more about Dali