# HG changeset patch # User Sebastien Jodogne # Date 1481360716 -3600 # Node ID c02f6ec404d8975abe35454d32aedea7bc4af33a # Parent c88c8807a0ed68b91c6cb85aa684142911261129 OrthancPlugins::FindMatcher diff -r c88c8807a0ed -r c02f6ec404d8 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- 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, diff -r c88c8807a0ed -r c02f6ec404d8 Plugins/Samples/Common/OrthancPluginCppWrapper.h --- 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,