changeset 4348:93c281752e7a

reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 06 Dec 2020 12:21:31 +0100
parents 3dffe8f7af48
children 85237ae3a076
files NEWS OrthancFramework/SharedLibrary/OrthancFramework.h.in OrthancFramework/Sources/DicomFormat/DicomTag.cpp OrthancFramework/Sources/DicomFormat/DicomTag.h OrthancFramework/Sources/HttpServer/FilesystemHttpSender.h OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.cpp OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h
diffstat 9 files changed, 56 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Sun Dec 06 11:42:39 2020 +0100
+++ b/NEWS	Sun Dec 06 12:21:31 2020 +0100
@@ -34,6 +34,7 @@
 * Fix keep-alive in the embedded HTTP server by setting the "Keep-Alive" HTTP header
 * Fix access to videos as a single raw frame (feature broken since Orthanc 1.6.0)
 * REST API now returns 404 error if deleting an inexistent peer or modality
+* Improved forward ABI compatibility of Orthanc Framework (notably, no inline methods anymore)
 * Upgraded dependencies for static builds (notably on Windows and LSB):
   - civetweb 1.13
 
--- a/OrthancFramework/SharedLibrary/OrthancFramework.h.in	Sun Dec 06 11:42:39 2020 +0100
+++ b/OrthancFramework/SharedLibrary/OrthancFramework.h.in	Sun Dec 06 12:21:31 2020 +0100
@@ -51,6 +51,7 @@
  * "OrthancFrameworkConfiguration.cmake"
  **/
 
+#define ORTHANC_BUILDING_FRAMEWORK_LIBRARY 0
 #define ORTHANC_ENABLE_BASE64 1
 #define ORTHANC_ENABLE_MD5 1
 
--- a/OrthancFramework/Sources/DicomFormat/DicomTag.cpp	Sun Dec 06 11:42:39 2020 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomTag.cpp	Sun Dec 06 12:21:31 2020 +0100
@@ -363,4 +363,13 @@
         throw OrthancException(ErrorCode_ParameterOutOfRange);
     }
   }
+
+
+#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
+  std::ostream& operator<< (std::ostream& o, const DicomTag& tag)
+  {
+    tag.FormatStream(o);
+    return o;
+  }
+#endif
 }
--- a/OrthancFramework/Sources/DicomFormat/DicomTag.h	Sun Dec 06 11:42:39 2020 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomTag.h	Sun Dec 06 12:21:31 2020 +0100
@@ -71,6 +71,10 @@
 
     static void AddTagsForModule(std::set<DicomTag>& target,
                                  DicomModule module);
+
+#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
+    ORTHANC_PUBLIC friend std::ostream& operator<< (std::ostream& o, const DicomTag& tag);
+#endif
   };
 
   // Aliases for the most useful tags
--- a/OrthancFramework/Sources/HttpServer/FilesystemHttpSender.h	Sun Dec 06 11:42:39 2020 +0100
+++ b/OrthancFramework/Sources/HttpServer/FilesystemHttpSender.h	Sun Dec 06 12:21:31 2020 +0100
@@ -37,7 +37,7 @@
     std::string      chunk_;
     size_t           chunkSize_;
 
-    void Initialize(const boost::filesystem::path& path) ORTHANC_LOCAL;
+    void Initialize(const boost::filesystem::path& path);
 
   public:
     explicit FilesystemHttpSender(const std::string& path);
--- a/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.cpp	Sun Dec 06 11:42:39 2020 +0100
+++ b/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.cpp	Sun Dec 06 12:21:31 2020 +0100
@@ -31,6 +31,14 @@
 
 namespace Orthanc
 {
+#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
+  void JobOperationValues::Append(JobOperationValue* value)
+  {
+    throw OrthancException(ErrorCode_DiscontinuedAbi, "Removed in 1.8.1");
+  }
+#endif
+    
+
   void JobOperationValues::Append(JobOperationValues& target,
                                   bool clear)
   {
--- a/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h	Sun Dec 06 11:42:39 2020 +0100
+++ b/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h	Sun Dec 06 12:21:31 2020 +0100
@@ -23,6 +23,7 @@
 #pragma once
 
 #include "IJobOperationValue.h"
+#include "../../Compatibility.h"
 
 #include <vector>
 
@@ -30,11 +31,28 @@
 {
   class IJobUnserializer;
 
+#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
+  class JobOperationValue
+  {
+    /**
+     * This is for ABI compatibility with Orthanc framework <= 1.8.0,
+     * only to be able to run unit tests from Orthanc 1.7.2 to
+     * 1.8.0. The class was moved to "IJobOperationValue" in 1.8.1,
+     * and its memory layout has changed. Don't use this anymore.
+     **/
+  };
+#endif
+
   class ORTHANC_PUBLIC JobOperationValues : public boost::noncopyable
   {
   private:
     std::vector<IJobOperationValue*>   values_;
 
+#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
+    // For binary compatibility with Orthanc <= 1.8.0
+    void Append(JobOperationValue* value) ORTHANC_DEPRECATED;
+#endif
+    
     void Append(JobOperationValues& target,
                 bool clear);
 
--- a/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp	Sun Dec 06 11:42:39 2020 +0100
+++ b/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp	Sun Dec 06 12:21:31 2020 +0100
@@ -236,6 +236,15 @@
   }
 
 
+#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
+  void SequenceOfOperationsJob::Lock::AddInput(size_t index,
+                                               const JobOperationValue& value)
+  {
+    throw OrthancException(ErrorCode_DiscontinuedAbi, "Removed in 1.8.1");
+  }
+#endif
+
+
   SequenceOfOperationsJob::Lock::Lock(SequenceOfOperationsJob& that) :
     that_(that),
     lock_(that.mutex_)
--- a/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h	Sun Dec 06 11:42:39 2020 +0100
+++ b/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h	Sun Dec 06 12:21:31 2020 +0100
@@ -84,6 +84,11 @@
       SequenceOfOperationsJob&   that_;
       boost::mutex::scoped_lock  lock_;
 
+#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
+      void AddInput(size_t index,
+                    const JobOperationValue& value) ORTHANC_DEPRECATED;
+#endif
+      
     public:
       explicit Lock(SequenceOfOperationsJob& that);