Mercurial > hg > orthanc-webviewer
comparison Plugin/Cache/CacheManager.h @ 147:70d1fe6d6309
Avoid hard crash if not enough memory
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 09 Nov 2016 12:43:58 +0100 |
parents | 3809121c3290 |
children | 5dc54316d68b |
comparison
equal
deleted
inserted
replaced
146:3cde3e806abe | 147:70d1fe6d6309 |
---|---|
20 | 20 |
21 #pragma once | 21 #pragma once |
22 | 22 |
23 #include "../../Orthanc/Core/SQLite/Connection.h" | 23 #include "../../Orthanc/Core/SQLite/Connection.h" |
24 #include "../../Orthanc/Core/FileStorage/FilesystemStorage.h" | 24 #include "../../Orthanc/Core/FileStorage/FilesystemStorage.h" |
25 | |
26 #include <orthanc/OrthancCPlugin.h> | |
25 | 27 |
26 namespace OrthancPlugins | 28 namespace OrthancPlugins |
27 { | 29 { |
28 enum CacheProperty | 30 enum CacheProperty |
29 { | 31 { |
67 | 69 |
68 void SanityCheck(); // Only for debug | 70 void SanityCheck(); // Only for debug |
69 | 71 |
70 | 72 |
71 public: | 73 public: |
72 CacheManager(Orthanc::SQLite::Connection& db, | 74 CacheManager(OrthancPluginContext* context, |
75 Orthanc::SQLite::Connection& db, | |
73 Orthanc::FilesystemStorage& storage); | 76 Orthanc::FilesystemStorage& storage); |
77 | |
78 OrthancPluginContext* GetPluginContext() const; | |
74 | 79 |
75 void SetSanityCheckEnabled(bool enabled); | 80 void SetSanityCheckEnabled(bool enabled); |
76 | 81 |
77 void Clear(); | 82 void Clear(); |
78 | 83 |