diff OrthancServer/SQLiteDatabaseWrapper.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 6c5d4281da4a
line wrap: on
line diff
--- a/OrthancServer/SQLiteDatabaseWrapper.h	Thu Dec 20 16:18:38 2018 +0100
+++ b/OrthancServer/SQLiteDatabaseWrapper.h	Thu Dec 20 16:42:35 2018 +0100
@@ -76,63 +76,80 @@
 
     SQLiteDatabaseWrapper();
 
-    virtual void Open();
+    virtual void Open()
+      ORTHANC_OVERRIDE;
 
     virtual void Close()
+      ORTHANC_OVERRIDE
     {
       db_.Close();
     }
 
-    virtual void SetListener(IDatabaseListener& listener);
+    virtual void SetListener(IDatabaseListener& listener)
+      ORTHANC_OVERRIDE;
 
     virtual bool LookupParent(int64_t& parentId,
-                              int64_t resourceId);
+                              int64_t resourceId)
+      ORTHANC_OVERRIDE;
 
-    virtual std::string GetPublicId(int64_t resourceId);
+    virtual std::string GetPublicId(int64_t resourceId)
+      ORTHANC_OVERRIDE;
 
-    virtual ResourceType GetResourceType(int64_t resourceId);
+    virtual ResourceType GetResourceType(int64_t resourceId)
+      ORTHANC_OVERRIDE;
 
-    virtual void DeleteResource(int64_t id);
+    virtual void DeleteResource(int64_t id)
+      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 GetLastChange(std::list<ServerIndexChange>& target /*out*/);
+    virtual void GetLastChange(std::list<ServerIndexChange>& target /*out*/)
+      ORTHANC_OVERRIDE;
 
-    virtual IDatabaseWrapper::ITransaction* StartTransaction();
+    virtual IDatabaseWrapper::ITransaction* StartTransaction()
+      ORTHANC_OVERRIDE;
 
     virtual void FlushToDisk()
+      ORTHANC_OVERRIDE
     {
       db_.FlushToDisk();
     }
 
     virtual bool HasFlushToDisk() const
+      ORTHANC_OVERRIDE
     {
       return true;
     }
 
     virtual void ClearChanges()
+      ORTHANC_OVERRIDE
     {
       ClearTable("Changes");
     }
 
     virtual void ClearExportedResources()
+      ORTHANC_OVERRIDE
     {
       ClearTable("ExportedResources");
     }
 
     virtual void GetAllMetadata(std::map<MetadataType, std::string>& target,
-                                int64_t id);
+                                int64_t id)
+      ORTHANC_OVERRIDE;
 
     virtual unsigned int GetDatabaseVersion()
+      ORTHANC_OVERRIDE
     {
       return version_;
     }
 
     virtual void Upgrade(unsigned int targetVersion,
-                         IStorageArea& storageArea);
+                         IStorageArea& storageArea)
+      ORTHANC_OVERRIDE;
 
 
     /**
@@ -161,114 +178,150 @@
      **/
 
     virtual void SetGlobalProperty(GlobalProperty property,
-                                   const std::string& value);
+                                   const std::string& value)
+      ORTHANC_OVERRIDE;
 
     virtual bool LookupGlobalProperty(std::string& target,
-                                      GlobalProperty property);
+                                      GlobalProperty property)
+      ORTHANC_OVERRIDE;
 
     virtual int64_t CreateResource(const std::string& publicId,
-                                   ResourceType type);
+                                   ResourceType type)
+      ORTHANC_OVERRIDE;
 
     virtual bool LookupResource(int64_t& id,
                                 ResourceType& type,
-                                const std::string& publicId);
+                                const std::string& publicId)
+      ORTHANC_OVERRIDE;
 
     virtual void AttachChild(int64_t parent,
-                             int64_t child);
+                             int64_t child)
+      ORTHANC_OVERRIDE;
 
     virtual void SetMetadata(int64_t id,
                              MetadataType type,
-                             const std::string& value);
+                             const std::string& value)
+      ORTHANC_OVERRIDE;
 
     virtual void DeleteMetadata(int64_t id,
-                                MetadataType type);
+                                MetadataType type)
+      ORTHANC_OVERRIDE;
 
     virtual bool LookupMetadata(std::string& target,
                                 int64_t id,
-                                MetadataType type);
+                                MetadataType type)
+      ORTHANC_OVERRIDE;
 
     virtual void ListAvailableMetadata(std::list<MetadataType>& target,
-                                       int64_t id);
+                                       int64_t id)
+      ORTHANC_OVERRIDE;
 
     virtual void AddAttachment(int64_t id,
-                               const FileInfo& attachment);
+                               const FileInfo& attachment)
+      ORTHANC_OVERRIDE;
 
     virtual void DeleteAttachment(int64_t id,
-                                  FileContentType attachment);
+                                  FileContentType attachment)
+      ORTHANC_OVERRIDE;
 
     virtual void ListAvailableAttachments(std::list<FileContentType>& target,
-                                          int64_t id);
+                                          int64_t id)
+      ORTHANC_OVERRIDE;
 
     virtual bool LookupAttachment(FileInfo& attachment,
                                   int64_t id,
-                                  FileContentType contentType);
+                                  FileContentType contentType)
+      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 GetMainDicomTags(DicomMap& map,
-                                  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 GetChildrenInternalId(std::list<int64_t>& 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 void GetExportedResources(std::list<ExportedResource>& target /*out*/,
                                       bool& done /*out*/,
                                       int64_t since,
-                                      uint32_t maxResults);
+                                      uint32_t maxResults)
+      ORTHANC_OVERRIDE;
 
-    virtual void GetLastExportedResource(std::list<ExportedResource>& target /*out*/);
+    virtual void GetLastExportedResource(std::list<ExportedResource>& target /*out*/)
+      ORTHANC_OVERRIDE;
 
-    virtual uint64_t GetTotalCompressedSize();
+    virtual uint64_t GetTotalCompressedSize()
+      ORTHANC_OVERRIDE;
     
-    virtual uint64_t GetTotalUncompressedSize();
+    virtual uint64_t GetTotalUncompressedSize()
+      ORTHANC_OVERRIDE;
 
-    virtual uint64_t GetResourceCount(ResourceType resourceType);
+    virtual uint64_t GetResourceCount(ResourceType resourceType)
+      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 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 bool IsProtectedPatient(int64_t internalId);
+    virtual bool IsProtectedPatient(int64_t internalId)
+      ORTHANC_OVERRIDE;
 
     virtual void SetProtectedPatient(int64_t internalId, 
-                                     bool isProtected);
+                                     bool isProtected)
+      ORTHANC_OVERRIDE;
 
-    virtual bool IsExistingResource(int64_t internalId);
+    virtual bool IsExistingResource(int64_t internalId)
+      ORTHANC_OVERRIDE;
 
-    virtual bool IsDiskSizeAbove(uint64_t threshold);
+    virtual bool IsDiskSizeAbove(uint64_t threshold)
+      ORTHANC_OVERRIDE;
 
     virtual void ApplyLookupResources(std::vector<std::string>& resourcesId,
                                       std::vector<std::string>* instancesId,
                                       const std::vector<DatabaseConstraint>& lookup,
                                       ResourceType queryLevel,
-                                      size_t limit);
+                                      size_t limit)
+      ORTHANC_OVERRIDE;
   };
 }