# HG changeset patch # User Sebastien Jodogne # Date 1592231217 -7200 # Node ID 474360793956afd82ab7f2398116998db0b54e34 # Parent 28c64c246312779768b31958329f4b6c0effbc99 DicomResourcesLoader::Create() diff -r 28c64c246312 -r 474360793956 Framework/Loaders/DicomResourcesLoader.cpp --- a/Framework/Loaders/DicomResourcesLoader.cpp Mon Jun 15 12:57:54 2020 +0200 +++ b/Framework/Loaders/DicomResourcesLoader.cpp Mon Jun 15 16:26:57 2020 +0200 @@ -602,7 +602,7 @@ } - boost::shared_ptr DicomResourcesLoader::Factory::Create(ILoadersContext::ILock& stone) + boost::shared_ptr DicomResourcesLoader::Create(ILoadersContext::ILock& stone) { boost::shared_ptr result(new DicomResourcesLoader(stone.GetContext())); result->Register(stone.GetOracleObservable(), &DicomResourcesLoader::Handle); @@ -614,7 +614,7 @@ result->Register(stone.GetOracleObservable(), &DicomResourcesLoader::Handle); #endif - return boost::shared_ptr(result); + return result; } diff -r 28c64c246312 -r 474360793956 Framework/Loaders/DicomResourcesLoader.h --- a/Framework/Loaders/DicomResourcesLoader.h Mon Jun 15 12:57:54 2020 +0200 +++ b/Framework/Loaders/DicomResourcesLoader.h Mon Jun 15 16:26:57 2020 +0200 @@ -147,9 +147,15 @@ class Factory : public ILoaderFactory { public: - virtual boost::shared_ptr Create(ILoadersContext::ILock& stone); + virtual boost::shared_ptr Create(ILoadersContext::ILock& stone) + { + return DicomResourcesLoader::Create(stone); + } }; + + static boost::shared_ptr Create(ILoadersContext::ILock& stone); + void ScheduleGetDicomWeb(boost::shared_ptr target, int priority, const DicomSource& source, diff -r 28c64c246312 -r 474360793956 Framework/Loaders/DicomSource.cpp --- a/Framework/Loaders/DicomSource.cpp Mon Jun 15 12:57:54 2020 +0200 +++ b/Framework/Loaders/DicomSource.cpp Mon Jun 15 16:26:57 2020 +0200 @@ -153,7 +153,7 @@ std::unique_ptr command(new HttpCommand); command->SetMethod(Orthanc::HttpMethod_Get); - command->SetUrl(webService_.GetUrl() + "/" + EncodeGetArguments(uri, arguments)); + command->SetUrl(webService_.GetUrl() + EncodeGetArguments(uri, arguments)); command->SetHttpHeaders(webService_.GetHttpHeaders()); for (std::map::const_iterator diff -r 28c64c246312 -r 474360793956 Framework/Loaders/OracleScheduler.cpp --- a/Framework/Loaders/OracleScheduler.cpp Mon Jun 15 12:57:54 2020 +0200 +++ b/Framework/Loaders/OracleScheduler.cpp Mon Jun 15 16:26:57 2020 +0200 @@ -463,7 +463,7 @@ { assert(PRIORITY_HIGH < 0 && PRIORITY_LOW > 0); - + if (maxLowPriority <= 0) { // There must be at least 1 lane available to deal with low-priority commands diff -r 28c64c246312 -r 474360793956 Framework/Loaders/SeriesMetadataLoader.cpp --- a/Framework/Loaders/SeriesMetadataLoader.cpp Mon Jun 15 12:57:54 2020 +0200 +++ b/Framework/Loaders/SeriesMetadataLoader.cpp Mon Jun 15 16:26:57 2020 +0200 @@ -189,9 +189,7 @@ boost::shared_ptr SeriesMetadataLoader::Factory::Create(ILoadersContext::ILock& context) { - DicomResourcesLoader::Factory factory; - boost::shared_ptr loader - (boost::dynamic_pointer_cast(factory.Create(context))); + boost::shared_ptr loader(DicomResourcesLoader::Create(context)); boost::shared_ptr obj(new SeriesMetadataLoader(loader)); obj->Register(*loader, &SeriesMetadataLoader::Handle); diff -r 28c64c246312 -r 474360793956 Framework/Loaders/WebAssemblyLoadersContext.cpp --- a/Framework/Loaders/WebAssemblyLoadersContext.cpp Mon Jun 15 12:57:54 2020 +0200 +++ b/Framework/Loaders/WebAssemblyLoadersContext.cpp Mon Jun 15 16:26:57 2020 +0200 @@ -79,9 +79,10 @@ unsigned int maxStandardPriority, unsigned int maxLowPriority) { + oracle_.GetOracleObservable(); scheduler_ = OracleScheduler::Create(oracle_, oracle_.GetOracleObservable(), oracle_, maxHighPriority, maxStandardPriority, maxLowPriority); - + if (!scheduler_) { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); diff -r 28c64c246312 -r 474360793956 Samples/Sdl/SingleFrameViewer/SdlSimpleViewerApplication.h --- a/Samples/Sdl/SingleFrameViewer/SdlSimpleViewerApplication.h Mon Jun 15 12:57:54 2020 +0200 +++ b/Samples/Sdl/SingleFrameViewer/SdlSimpleViewerApplication.h Mon Jun 15 16:26:57 2020 +0200 @@ -57,8 +57,7 @@ { std::auto_ptr lock(context.Lock()); - DicomResourcesLoader::Factory f; - application->dicomLoader_ = boost::dynamic_pointer_cast(f.Create(*lock)); + application->dicomLoader_ = DicomResourcesLoader::Create(*lock); } application->Register(*application->dicomLoader_, &SdlSimpleViewerApplication::Handle); diff -r 28c64c246312 -r 474360793956 Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApplication.h --- a/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApplication.h Mon Jun 15 12:57:54 2020 +0200 +++ b/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApplication.h Mon Jun 15 16:26:57 2020 +0200 @@ -101,8 +101,7 @@ { std::auto_ptr lock(context.Lock()); - DicomResourcesLoader::Factory f; - application->dicomLoader_ = boost::dynamic_pointer_cast(f.Create(*lock)); + application->dicomLoader_ = DicomResourcesLoader::Create(*lock); } application->Register(*application->dicomLoader_, &Application::Handle); @@ -313,10 +312,7 @@ { std::auto_ptr lock(context.Lock()); - { - DicomResourcesLoader::Factory f; - application->resourcesLoader_ = boost::dynamic_pointer_cast(f.Create(*lock)); - } + application->resourcesLoader_ = DicomResourcesLoader::Create(*lock); { SeriesThumbnailsLoader::Factory f;