changeset 6897:55194a6e7d07 streaming

defining ORTHANC_DEPRECATED_CLASS macro
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 01 Jun 2026 22:14:15 +0200
parents a6f84df80a28
children 26f91b7e621d
files OrthancFramework/Sources/Cache/ICachePageProvider.h OrthancFramework/Sources/Cache/ICacheable.h OrthancFramework/Sources/Cache/MemoryCache.h OrthancFramework/Sources/Cache/MemoryObjectCache.h OrthancFramework/Sources/Cache/MemoryStringCache.h OrthancFramework/Sources/Compatibility.h OrthancFramework/Sources/DicomParsing/ParsedDicomCache.h
diffstat 7 files changed, 18 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Cache/ICachePageProvider.h	Mon Jun 01 21:58:59 2026 +0200
+++ b/OrthancFramework/Sources/Cache/ICachePageProvider.h	Mon Jun 01 22:14:15 2026 +0200
@@ -33,7 +33,7 @@
 {
   namespace Deprecated
   {
-    class ORTHANC_DEPRECATED(ICachePageProvider)
+    class ORTHANC_DEPRECATED_CLASS(ICachePageProvider)
     {
     public:
       virtual ~ICachePageProvider()
--- a/OrthancFramework/Sources/Cache/ICacheable.h	Mon Jun 01 21:58:59 2026 +0200
+++ b/OrthancFramework/Sources/Cache/ICacheable.h	Mon Jun 01 22:14:15 2026 +0200
@@ -30,7 +30,7 @@
 
 namespace Orthanc
 {
-  class ORTHANC_DEPRECATED(ICacheable) : public boost::noncopyable
+  class ORTHANC_DEPRECATED_CLASS(ICacheable) : public boost::noncopyable
   {
   public:
     virtual ~ICacheable()
--- a/OrthancFramework/Sources/Cache/MemoryCache.h	Mon Jun 01 21:58:59 2026 +0200
+++ b/OrthancFramework/Sources/Cache/MemoryCache.h	Mon Jun 01 22:14:15 2026 +0200
@@ -37,7 +37,7 @@
     /**
      * WARNING: This class is NOT thread-safe.
      **/
-    class ORTHANC_PUBLIC ORTHANC_DEPRECATED(MemoryCache) : public boost::noncopyable
+    class ORTHANC_PUBLIC ORTHANC_DEPRECATED_CLASS(MemoryCache) : public boost::noncopyable
     {
     private:
       struct Page
--- a/OrthancFramework/Sources/Cache/MemoryObjectCache.h	Mon Jun 01 21:58:59 2026 +0200
+++ b/OrthancFramework/Sources/Cache/MemoryObjectCache.h	Mon Jun 01 22:14:15 2026 +0200
@@ -42,7 +42,7 @@
   /**
    *  Note: this class is thread safe
    **/
-  class ORTHANC_PUBLIC ORTHANC_DEPRECATED(MemoryObjectCache) : public boost::noncopyable
+  class ORTHANC_PUBLIC ORTHANC_DEPRECATED_CLASS(MemoryObjectCache) : public boost::noncopyable
   {
   private:
     class Item;
--- a/OrthancFramework/Sources/Cache/MemoryStringCache.h	Mon Jun 01 21:58:59 2026 +0200
+++ b/OrthancFramework/Sources/Cache/MemoryStringCache.h	Mon Jun 01 22:14:15 2026 +0200
@@ -46,7 +46,7 @@
    * 
    * Note: this class is thread safe
    **/
-  class ORTHANC_PUBLIC ORTHANC_DEPRECATED(MemoryStringCache) : public boost::noncopyable
+  class ORTHANC_PUBLIC ORTHANC_DEPRECATED_CLASS(MemoryStringCache) : public boost::noncopyable
   {
   public:
     class ORTHANC_PUBLIC Accessor : public boost::noncopyable
--- a/OrthancFramework/Sources/Compatibility.h	Mon Jun 01 21:58:59 2026 +0200
+++ b/OrthancFramework/Sources/Compatibility.h	Mon Jun 01 22:14:15 2026 +0200
@@ -47,6 +47,18 @@
 #endif
 
 
+// Macro "ORTHANC_DEPRECATED_CLASS" tags a class as having been deprecated
+#if (__cplusplus >= 201402L)  // C++14
+#  define ORTHANC_DEPRECATED_CLASS(f) [[deprecated]] f
+#elif defined(__GNUC__) || defined(__clang__)
+#  define ORTHANC_DEPRECATED_CLASS(f) __attribute__((deprecated)) f
+#elif defined(_MSC_VER)
+#  define ORTHANC_DEPRECATED_CLASS(f) __declspec(deprecated) f
+#else
+#  define ORTHANC_DEPRECATED
+#endif
+
+
 // Macros "ORTHANC_OVERRIDE" and "ORTHANC_FINAL" wrap the "override"
 // and "final" keywords introduced in C++11, to do compile-time
 // checking of virtual methods
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomCache.h	Mon Jun 01 21:58:59 2026 +0200
+++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomCache.h	Mon Jun 01 22:14:15 2026 +0200
@@ -29,7 +29,7 @@
 
 namespace Orthanc
 {
-  class ORTHANC_PUBLIC ORTHANC_DEPRECATED(ParsedDicomCache) : public boost::noncopyable
+  class ORTHANC_PUBLIC ORTHANC_DEPRECATED_CLASS(ParsedDicomCache) : public boost::noncopyable
   {
   private:
     class Item;