diff Plugins/Engine/OrthancPluginDatabase.h @ 3050:d8a91acb7424 db-changes

working on a database compatibility layer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 Dec 2018 16:42:35 +0100
parents 53d583d2c775
children 39db63e68dcf
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPluginDatabase.h	Thu Dec 20 16:18:38 2018 +0100
+++ b/Plugins/Engine/OrthancPluginDatabase.h	Thu Dec 20 16:42:35 2018 +0100
@@ -96,9 +96,11 @@
                           size_t extensionsSize,
                           void *payload);
 
-    virtual void Open();
+    virtual void Open() 
+      ORTHANC_OVERRIDE;
 
-    virtual void Close()
+    virtual void Close() 
+      ORTHANC_OVERRIDE
     {
       CheckSuccess(backend_.close(payload_));
     }
@@ -109,161 +111,229 @@
     }
 
     virtual void AddAttachment(int64_t id,
-                               const FileInfo& attachment);
+                               const FileInfo& attachment) 
+      ORTHANC_OVERRIDE;
 
     virtual void AttachChild(int64_t parent,
-                             int64_t child);
+                             int64_t child) 
+      ORTHANC_OVERRIDE;
 
-    virtual void ClearChanges();
+    virtual void ClearChanges() 
+      ORTHANC_OVERRIDE;
 
-    virtual void ClearExportedResources();
+    virtual void ClearExportedResources() 
+      ORTHANC_OVERRIDE;
 
     virtual int64_t CreateResource(const std::string& publicId,
-                                   ResourceType type);
+                                   ResourceType type) 
+      ORTHANC_OVERRIDE;
 
     virtual void DeleteAttachment(int64_t id,
-                                  FileContentType attachment);
+                                  FileContentType attachment) 
+      ORTHANC_OVERRIDE;
 
     virtual void DeleteMetadata(int64_t id,
-                                MetadataType type);
+                                MetadataType type) 
+      ORTHANC_OVERRIDE;
 
-    virtual void DeleteResource(int64_t id);
+    virtual void DeleteResource(int64_t id) 
+      ORTHANC_OVERRIDE;
 
-    virtual void FlushToDisk()
+    virtual void FlushToDisk() 
+      ORTHANC_OVERRIDE
     {
     }
 
-    virtual bool HasFlushToDisk() const
+    virtual bool HasFlushToDisk() const 
+      ORTHANC_OVERRIDE
     {
       return false;
     }
 
     virtual void GetAllMetadata(std::map<MetadataType, std::string>& target,
-                                int64_t id);
+                                int64_t id) 
+      ORTHANC_OVERRIDE;
 
     virtual void GetAllInternalIds(std::list<int64_t>& target,
-                                   ResourceType resourceType);
+                                   ResourceType resourceType) 
+      ORTHANC_OVERRIDE;
 
     virtual void GetAllPublicIds(std::list<std::string>& target,
-                                 ResourceType resourceType);
+                                 ResourceType resourceType) 
+      ORTHANC_OVERRIDE;
 
     virtual void GetAllPublicIds(std::list<std::string>& target,
                                  ResourceType resourceType,
                                  size_t since,
-                                 size_t limit);
+                                 size_t limit) 
+      ORTHANC_OVERRIDE;
 
     virtual void GetChanges(std::list<ServerIndexChange>& target /*out*/,
                             bool& done /*out*/,
                             int64_t since,
-                            uint32_t maxResults);
+                            uint32_t maxResults) 
+      ORTHANC_OVERRIDE;
 
     virtual void GetChildrenInternalId(std::list<int64_t>& target,
-                                       int64_t id);
+                                       int64_t id) 
+      ORTHANC_OVERRIDE;
 
     virtual void GetChildrenPublicId(std::list<std::string>& target,
-                                     int64_t id);
+                                     int64_t id) 
+      ORTHANC_OVERRIDE;
 
     virtual void GetExportedResources(std::list<ExportedResource>& target /*out*/,
                                       bool& done /*out*/,
                                       int64_t since,
-                                      uint32_t maxResults);
+                                      uint32_t maxResults) 
+      ORTHANC_OVERRIDE;
 
-    virtual void GetLastChange(std::list<ServerIndexChange>& target /*out*/);
+    virtual void GetLastChange(std::list<ServerIndexChange>& target /*out*/) 
+      ORTHANC_OVERRIDE;
 
-    virtual void GetLastExportedResource(std::list<ExportedResource>& target /*out*/);
+    virtual void GetLastExportedResource(std::list<ExportedResource>& target /*out*/) 
+      ORTHANC_OVERRIDE;
 
     virtual void GetMainDicomTags(DicomMap& map,
-                                  int64_t id);
+                                  int64_t id) 
+      ORTHANC_OVERRIDE;
 
-    virtual std::string GetPublicId(int64_t resourceId);
+    virtual std::string GetPublicId(int64_t resourceId) 
+      ORTHANC_OVERRIDE;
 
-    virtual uint64_t GetResourceCount(ResourceType resourceType);
+    virtual uint64_t GetResourceCount(ResourceType resourceType) 
+      ORTHANC_OVERRIDE;
 
-    virtual ResourceType GetResourceType(int64_t resourceId);
+    virtual ResourceType GetResourceType(int64_t resourceId) 
+      ORTHANC_OVERRIDE;
 
-    virtual uint64_t GetTotalCompressedSize();
+    virtual uint64_t GetTotalCompressedSize() 
+      ORTHANC_OVERRIDE;
     
-    virtual uint64_t GetTotalUncompressedSize();
+    virtual uint64_t GetTotalUncompressedSize() 
+      ORTHANC_OVERRIDE;
 
-    virtual bool IsExistingResource(int64_t internalId);
+    virtual bool IsExistingResource(int64_t internalId) 
+      ORTHANC_OVERRIDE;
 
-    virtual bool IsProtectedPatient(int64_t internalId);
+    virtual bool IsProtectedPatient(int64_t internalId) 
+      ORTHANC_OVERRIDE;
 
     virtual void ListAvailableMetadata(std::list<MetadataType>& target,
-                                       int64_t id);
+                                       int64_t id) 
+      ORTHANC_OVERRIDE;
 
     virtual void ListAvailableAttachments(std::list<FileContentType>& target,
-                                          int64_t id);
+                                          int64_t id) 
+      ORTHANC_OVERRIDE;
 
     virtual void LogChange(int64_t internalId,
-                           const ServerIndexChange& change);
+                           const ServerIndexChange& change) 
+      ORTHANC_OVERRIDE;
 
-    virtual void LogExportedResource(const ExportedResource& resource);
+    virtual void LogExportedResource(const ExportedResource& resource) 
+      ORTHANC_OVERRIDE;
     
     virtual bool LookupAttachment(FileInfo& attachment,
                                   int64_t id,
-                                  FileContentType contentType);
+                                  FileContentType contentType) 
+      ORTHANC_OVERRIDE;
 
     virtual bool LookupGlobalProperty(std::string& target,
-                                      GlobalProperty property);
+                                      GlobalProperty property) 
+      ORTHANC_OVERRIDE;
 
     virtual bool LookupMetadata(std::string& target,
                                 int64_t id,
-                                MetadataType type);
+                                MetadataType type) 
+      ORTHANC_OVERRIDE;
 
     virtual bool LookupParent(int64_t& parentId,
-                              int64_t resourceId);
+                              int64_t resourceId) 
+      ORTHANC_OVERRIDE;
 
     virtual bool LookupResource(int64_t& id,
                                 ResourceType& type,
-                                const std::string& publicId);
+                                const std::string& publicId) 
+      ORTHANC_OVERRIDE;
 
-    virtual bool SelectPatientToRecycle(int64_t& internalId);
+    virtual bool SelectPatientToRecycle(int64_t& internalId) 
+      ORTHANC_OVERRIDE;
 
     virtual bool SelectPatientToRecycle(int64_t& internalId,
-                                        int64_t patientIdToAvoid);
+                                        int64_t patientIdToAvoid) 
+      ORTHANC_OVERRIDE;
 
     virtual void SetGlobalProperty(GlobalProperty property,
-                                   const std::string& value);
+                                   const std::string& value) 
+      ORTHANC_OVERRIDE;
 
-    virtual void ClearMainDicomTags(int64_t id);
+    virtual void ClearMainDicomTags(int64_t id) 
+      ORTHANC_OVERRIDE;
 
     virtual void SetMainDicomTag(int64_t id,
                                  const DicomTag& tag,
-                                 const std::string& value);
+                                 const std::string& value) 
+      ORTHANC_OVERRIDE;
 
     virtual void SetIdentifierTag(int64_t id,
                                   const DicomTag& tag,
-                                  const std::string& value);
+                                  const std::string& value) 
+      ORTHANC_OVERRIDE;
 
     virtual void SetMetadata(int64_t id,
                              MetadataType type,
-                             const std::string& value);
+                             const std::string& value) 
+      ORTHANC_OVERRIDE;
 
     virtual void SetProtectedPatient(int64_t internalId, 
-                                     bool isProtected);
+                                     bool isProtected) 
+      ORTHANC_OVERRIDE;
 
-    virtual IDatabaseWrapper::ITransaction* StartTransaction();
+    virtual IDatabaseWrapper::ITransaction* StartTransaction() 
+      ORTHANC_OVERRIDE;
 
-    virtual void SetListener(IDatabaseListener& listener)
+    virtual void SetListener(IDatabaseListener& listener) 
+      ORTHANC_OVERRIDE
     {
       listener_ = &listener;
     }
 
-    virtual unsigned int GetDatabaseVersion();
+    virtual unsigned int GetDatabaseVersion() 
+      ORTHANC_OVERRIDE;
 
     virtual void Upgrade(unsigned int targetVersion,
-                         IStorageArea& storageArea);
+                         IStorageArea& storageArea) 
+      ORTHANC_OVERRIDE;
 
-    void AnswerReceived(const _OrthancPluginDatabaseAnswer& answer);
+    void AnswerReceived(const _OrthancPluginDatabaseAnswer& answer) 
+      ORTHANC_OVERRIDE;
 
-    virtual bool IsDiskSizeAbove(uint64_t threshold);
+    virtual bool IsDiskSizeAbove(uint64_t threshold) 
+      ORTHANC_OVERRIDE;
 
     virtual void ApplyLookupResources(std::vector<std::string>& patientsId,
                                       std::vector<std::string>* instancesId,
                                       const std::vector<DatabaseConstraint>& lookup,
                                       ResourceType queryLevel,
-                                      size_t limit);
+                                      size_t limit)
+      ORTHANC_OVERRIDE;
+
+    // From the "CompatibilityDatabaseWrapper" interface
+    virtual void LookupIdentifier(std::list<int64_t>& result,
+                                  ResourceType level,
+                                  const DicomTag& tag,
+                                  IdentifierConstraintType type,
+                                  const std::string& value)
+      ORTHANC_OVERRIDE;
+    
+    // From the "CompatibilityDatabaseWrapper" interface
+    virtual void LookupIdentifierRange(std::list<int64_t>& result,
+                                       ResourceType level,
+                                       const DicomTag& tag,
+                                       const std::string& start,
+                                       const std::string& end)
+      ORTHANC_OVERRIDE;
   };
 }