ArcGIS Procedural Runtime  3.2.10650
Cache.h
1 /*
2  COPYRIGHT (c) 2012-2024 Esri R&D Center Zurich
3  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
4  Unpublished material - all rights reserved under the
5  Copyright Laws of the United States and applicable international
6  laws, treaties, and conventions.
7 
8  For additional information, contact:
9  Environmental Systems Research Institute, Inc.
10  Attn: Contracts and Legal Services Department
11  380 New York Street
12  Redlands, California, 92373
13  USA
14 
15  email: contracts@esri.com
16 */
17 
18 #ifndef PRT_CACHE_H_
19 #define PRT_CACHE_H_
20 
21 #include "prt/Object.h"
22 #include "prt/ContentType.h"
23 
24 
25 namespace prt {
26 
53 class PRT_EXPORTS_API Cache {
54 public:
78  CACHE_TYPE_PIXELDATA
79  };
80 
92  virtual const void* insertAndGetTransientBlob(ContentType type, const wchar_t* key, const void* ptr) = 0;
93 
102  virtual const void* getTransientBlob(ContentType type, const wchar_t* key) const = 0;
103 
110  virtual void releaseTransientBlob(ContentType type, const wchar_t* key) = 0;
111 
121  virtual bool tryLockPersistentBlobs(ContentType type, const wchar_t* key) = 0;
122 
131  virtual void insertPersistentBlobAndLock(PersistentBlobType type, const wchar_t* key, const void* data, size_t size) = 0;
132 
145  virtual const void* getPersistentBlob(PersistentBlobType type, const wchar_t* key, size_t* size) const = 0;
146 
154  virtual void releasePersistentBlob(PersistentBlobType type, const wchar_t* key) = 0;
155 
163  virtual void unlockPersistentBlob(PersistentBlobType type, const wchar_t* key) = 0;
164 
173  virtual void flushAll() = 0;
174 
186  virtual void flushContentType(ContentType type) = 0;
187 
199  virtual void flushEntry(ContentType type, const wchar_t* key) = 0;
200 
201 protected:
208  static void deleteTransientBlob(const void *ptr);
209 
210 protected:
211  Cache();
212  virtual ~Cache();
213 };
214 
218 class PRT_EXPORTS_API CacheObject : public Object, public Cache {
219 public:
223  enum CacheType {
226  CACHE_TYPE_COUNT
227  };
228  static CacheObject* create(CacheType type);
229 };
230 
231 } // namespace prt
232 
233 #endif /* PRT_CACHE_H_ */
CacheType
Definition: Cache.h:223
A straight-forward cache implementation.
Definition: Cache.h:224
Definition: Object.h:35
ContentType
Definition: ContentType.h:28
Definition: Cache.h:53
Definition: Cache.h:218
The Procedural Runtime API namespace. The prt namespace contains the top level entry points into the ...
Definition: Annotation.h:24
PersistentBlobType
Definition: Cache.h:58
Detects identical permanent blobs (i.e. textures) and removes that redundancy.
Definition: Cache.h:225