changeset 2212:c02f6ec404d8

OrthancPlugins::FindMatcher
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 10 Dec 2016 10:05:16 +0100
parents c88c8807a0ed
children 95d1d758abb7
files Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Plugins/Samples/Common/OrthancPluginCppWrapper.h
diffstat 2 files changed, 56 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Sat Dec 10 09:41:15 2016 +0100
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Sat Dec 10 10:05:16 2016 +0100
@@ -835,6 +835,42 @@
   }
 
 
+  FindMatcher::FindMatcher(OrthancPluginContext*              context,
+                           const OrthancPluginWorklistQuery*  query) :
+    context_(context),
+    matcher_(NULL),
+    query_(query)
+  {
+    if (query_ == NULL)
+    {
+      ORTHANC_PLUGINS_THROW_EXCEPTION(OrthancPluginErrorCode_ParameterOutOfRange);
+    }
+  }
+
+
+  FindMatcher::FindMatcher(OrthancPluginContext*  context,
+                           const void*            query,
+                           uint32_t               size) :
+    context_(context),
+    query_(NULL)
+  {
+    matcher_ = OrthancPluginCreateFindMatcher(context_, query, size);
+    if (matcher_ == NULL)
+    {
+      ORTHANC_PLUGINS_THROW_EXCEPTION(OrthancPluginErrorCode_InternalError);
+    }
+  }
+
+
+  FindMatcher::~FindMatcher()
+  {
+    if (matcher_ != NULL)
+    {
+      OrthancPluginFreeFindMatcher(context_, matcher_);
+    }
+  }
+
+
   bool RestApiGet(Json::Value& result,
                   OrthancPluginContext* context,
                   const std::string& uri,
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Sat Dec 10 09:41:15 2016 +0100
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Sat Dec 10 10:05:16 2016 +0100
@@ -276,7 +276,7 @@
                         float defaultValue) const;
   };
 
-  class OrthancImage
+  class OrthancImage : public boost::noncopyable
   {
   private:
     OrthancPluginContext*  context_;
@@ -334,6 +334,25 @@
   };
 
 
+  class FindMatcher : public boost::noncopyable
+  {
+  private:
+    OrthancPluginContext*              context_;
+    OrthancPluginFindMatcher*          matcher_;
+    const OrthancPluginWorklistQuery*  query_;
+
+  public:
+    FindMatcher(OrthancPluginContext*              context,
+                const OrthancPluginWorklistQuery*  query);
+
+    FindMatcher(OrthancPluginContext*  context,
+                const void*            query,
+                uint32_t               size);
+
+    ~FindMatcher();
+  };
+
+
   bool RestApiGet(Json::Value& result,
                   OrthancPluginContext* context,
                   const std::string& uri,