comparison Plugins/Samples/Common/OrthancPluginCppWrapper.cpp @ 2212:c02f6ec404d8

OrthancPlugins::FindMatcher
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 10 Dec 2016 10:05:16 +0100
parents 27106f7e3759
children 95d1d758abb7
comparison
equal deleted inserted replaced
2211:c88c8807a0ed 2212:c02f6ec404d8
833 OrthancPluginCompressAndAnswerJpegImage(context_, output, GetPixelFormat(), 833 OrthancPluginCompressAndAnswerJpegImage(context_, output, GetPixelFormat(),
834 GetWidth(), GetHeight(), GetPitch(), GetBuffer(), quality); 834 GetWidth(), GetHeight(), GetPitch(), GetBuffer(), quality);
835 } 835 }
836 836
837 837
838 FindMatcher::FindMatcher(OrthancPluginContext* context,
839 const OrthancPluginWorklistQuery* query) :
840 context_(context),
841 matcher_(NULL),
842 query_(query)
843 {
844 if (query_ == NULL)
845 {
846 ORTHANC_PLUGINS_THROW_EXCEPTION(OrthancPluginErrorCode_ParameterOutOfRange);
847 }
848 }
849
850
851 FindMatcher::FindMatcher(OrthancPluginContext* context,
852 const void* query,
853 uint32_t size) :
854 context_(context),
855 query_(NULL)
856 {
857 matcher_ = OrthancPluginCreateFindMatcher(context_, query, size);
858 if (matcher_ == NULL)
859 {
860 ORTHANC_PLUGINS_THROW_EXCEPTION(OrthancPluginErrorCode_InternalError);
861 }
862 }
863
864
865 FindMatcher::~FindMatcher()
866 {
867 if (matcher_ != NULL)
868 {
869 OrthancPluginFreeFindMatcher(context_, matcher_);
870 }
871 }
872
873
838 bool RestApiGet(Json::Value& result, 874 bool RestApiGet(Json::Value& result,
839 OrthancPluginContext* context, 875 OrthancPluginContext* context,
840 const std::string& uri, 876 const std::string& uri,
841 bool applyPlugins) 877 bool applyPlugins)
842 { 878 {