Overte C++ Documentation
KTXCache.h
1 //
2 // KTXCache.h
3 // libraries/model-networking/src
4 //
5 // Created by Zach Pomerantz 2/22/2017.
6 // Copyright 2017 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_KTXCache_h
13 #define hifi_KTXCache_h
14 
15 #include <QUrl>
16 
17 #include <shared/FileCache.h>
18 
19 namespace ktx {
20  class KTX;
21 }
22 
23 class KTXFile;
24 using KTXFilePointer = std::shared_ptr<KTXFile>;
25 
26 class KTXCache : public cache::FileCache {
27  Q_OBJECT
28 
29 public:
30  // Whenever a change is made to the serialized format for the KTX cache that isn't backward compatible,
31  // this value should be incremented. This will force the KTX cache to be wiped
32  static const int CURRENT_VERSION;
33  static const int INVALID_VERSION;
34  static const char* SETTING_VERSION_NAME;
35 
36  KTXCache(const std::string& dir, const std::string& ext);
37 
38  void initialize() override;
39 
40 protected:
41  std::unique_ptr<cache::File> createFile(Metadata&& metadata, const std::string& filepath) override final;
42 };
43 
44 #endif // hifi_KTXCache_h