diff OrthancServer/Sources/Database/IDatabaseWrapper.h @ 5593:862b54b4cfe2 find-refactoring

implemented the default multi-stage find/expand
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 04 May 2024 11:35:34 +0200
parents b0b5546f1b9f
children 4640b7ae9a11
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/IDatabaseWrapper.h	Fri May 03 21:26:06 2024 +0200
+++ b/OrthancServer/Sources/Database/IDatabaseWrapper.h	Sat May 04 11:35:34 2024 +0200
@@ -357,9 +357,28 @@
        * Primitives introduced in Orthanc 1.12.4
        **/
 
+      // This is only implemented if "HasIntegratedFind()" is "true"
       virtual void ExecuteFind(FindResponse& response,
                                const FindRequest& request,
                                const std::vector<DatabaseConstraint>& normalized) = 0;
+
+      // This is only implemented if "HasIntegratedFind()" is "false"
+      virtual void ExecuteFind(std::list<std::string>& identifiers,
+                               const FindRequest& request,
+                               const std::vector<DatabaseConstraint>& normalized) = 0;
+
+      /**
+       * This is only implemented if "HasIntegratedFind()" is
+       * "false". In this flavor, the resource of interest might have
+       * been deleted, as the expansion is not done in the same
+       * transaction as the "ExecuteFind()". In such cases, the
+       * wrapper should not throw an exception, but simply ignore the
+       * request to expand the resource (i.e., "response" must not be
+       * modified).
+       **/
+      virtual void ExecuteExpand(FindResponse& response,
+                                 const FindRequest& request,
+                                 const std::string& identifier) = 0;
     };
 
 
@@ -384,5 +403,9 @@
     virtual const Capabilities GetDatabaseCapabilities() const = 0;
 
     virtual uint64_t MeasureLatency() = 0;
+
+    // Returns "true" iff. the database engine supports the
+    // simultaneous find and expansion of resources.
+    virtual bool HasIntegratedFind() const = 0;
   };
 }