changeset 2231:61e0564d03bb

backwards compatibility within OrthancPluginCppWrapper
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 14 Dec 2016 16:41:58 +0100
parents 40293e60f224
children 3dd44baebc36
files Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Plugins/Samples/Common/OrthancPluginCppWrapper.h
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Wed Dec 14 11:05:48 2016 +0100
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Wed Dec 14 16:41:58 2016 +0100
@@ -835,6 +835,8 @@
   }
 
 
+
+#if HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1
   FindMatcher::FindMatcher(OrthancPluginContext*              context,
                            const OrthancPluginWorklistQuery*  worklist) :
     context_(context),
@@ -907,6 +909,7 @@
     }
   }
 
+#endif /* HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1 */
 
 
   bool RestApiGet(Json::Value& result,
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Wed Dec 14 11:05:48 2016 +0100
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Wed Dec 14 16:41:58 2016 +0100
@@ -50,6 +50,17 @@
 #endif
 
 
+#if (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER >= 2 ||   \
+     (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == 1 &&  \
+      ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER >= 2))
+// The "OrthancPluginFindMatcher()" primitive was introduced in Orthanc 1.2.0
+#  define HAS_ORTHANC_PLUGIN_FIND_MATCHER  1
+#else
+#  define HAS_ORTHANC_PLUGIN_FIND_MATCHER  0
+#endif
+
+
+
 
 namespace OrthancPlugins
 {
@@ -334,6 +345,7 @@
   };
 
 
+#if HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1
   class FindMatcher : public boost::noncopyable
   {
   private:
@@ -372,6 +384,7 @@
       return IsMatch(dicom.GetData(), dicom.GetSize());
     }
   };
+#endif
 
 
   bool RestApiGet(Json::Value& result,