diff OrthancServer/ServerIndex.h @ 546:0e510ea3de31 laaw

merge mainline -> laaw
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 13 Sep 2013 11:25:08 +0200
parents 2c739f76d0bb
children b2357f1f026f
line wrap: on
line diff
--- a/OrthancServer/ServerIndex.h	Fri Sep 13 11:10:58 2013 +0200
+++ b/OrthancServer/ServerIndex.h	Fri Sep 13 11:25:08 2013 +0200
@@ -34,6 +34,7 @@
 
 #include <boost/thread.hpp>
 #include <boost/noncopyable.hpp>
+#include "../Core/Cache/LeastRecentlyUsedIndex.h"
 #include "../Core/SQLite/Connection.h"
 #include "../Core/DicomFormat/DicomMap.h"
 #include "../Core/DicomFormat/DicomInstanceHasher.h"
@@ -55,17 +56,25 @@
   {
   private:
     class Transaction;
+    struct UnstableResourcePayload;
 
+    bool done_;
     boost::mutex mutex_;
     boost::thread flushThread_;
+    boost::thread unstableResourcesMonitorThread_;
 
     std::auto_ptr<Internals::ServerIndexListener> listener_;
     std::auto_ptr<DatabaseWrapper> db_;
+    LeastRecentlyUsedIndex<int64_t, UnstableResourcePayload>  unstableResources_;
 
     uint64_t currentStorageSize_;
     uint64_t maximumStorageSize_;
     unsigned int maximumPatients_;
 
+    static void FlushThread(ServerIndex* that);
+
+    static void UnstableResourcesMonitorThread(ServerIndex* that);
+
     void MainDicomTagsToJson(Json::Value& result,
                              int64_t resourceId);
 
@@ -78,6 +87,9 @@
 
     void StandaloneRecycling();
 
+    void MarkAsUnstable(int64_t id,
+                        Orthanc::ResourceType type);
+
   public:
     typedef std::list<FileInfo> Attachments;
 
@@ -174,5 +186,12 @@
 
     void GetStatistics(Json::Value& target,
                        const std::string& publicId);
+
+    void LookupTagValue(std::list<std::string>& result,
+                        DicomTag tag,
+                        const std::string& value);
+
+    void LookupTagValue(std::list<std::string>& result,
+                        const std::string& value);
   };
 }