# HG changeset patch # User Sebastien Jodogne # Date 1539846144 -7200 # Node ID c34784e5f2992a1005ba8b1d4e698ff382aee063 # Parent 08683537a227648b2d00994d232127f9f4abda06 compatibility fixes diff -r 08683537a227 -r c34784e5f299 Applications/Generic/NativeStoneApplicationContext.h --- a/Applications/Generic/NativeStoneApplicationContext.h Wed Oct 17 19:42:56 2018 +0200 +++ b/Applications/Generic/NativeStoneApplicationContext.h Thu Oct 18 09:02:24 2018 +0200 @@ -37,11 +37,11 @@ static void UpdateThread(NativeStoneApplicationContext* that); - boost::mutex globalMutex_; - std::unique_ptr centralViewport_; - boost::thread updateThread_; - bool stopped_; - unsigned int updateDelayInMs_; + boost::mutex globalMutex_; + std::auto_ptr centralViewport_; + boost::thread updateThread_; + bool stopped_; + unsigned int updateDelayInMs_; public: class GlobalMutexLocker: public boost::noncopyable @@ -50,15 +50,22 @@ public: GlobalMutexLocker(NativeStoneApplicationContext& that): lock_(that.globalMutex_) - {} + { + } }; NativeStoneApplicationContext(); - virtual ~NativeStoneApplicationContext() {} + virtual ~NativeStoneApplicationContext() + { + } virtual IWidget& SetCentralWidget(IWidget* widget); // Takes ownership - IViewport& GetCentralViewport() {return *(centralViewport_.get());} + + IViewport& GetCentralViewport() + { + return *(centralViewport_.get()); + } void Start(); @@ -68,6 +75,5 @@ { updateDelayInMs_ = delayInMs; } - }; } diff -r 08683537a227 -r c34784e5f299 Applications/Samples/SimpleViewerApplicationSingleFile.h --- a/Applications/Samples/SimpleViewerApplicationSingleFile.h Wed Oct 17 19:42:56 2018 +0200 +++ b/Applications/Samples/SimpleViewerApplicationSingleFile.h Thu Oct 18 09:02:24 2018 +0200 @@ -212,22 +212,23 @@ Tools_CircleMeasure }; - Tools currentTool_; - std::unique_ptr mainWidgetInteractor_; - std::unique_ptr thumbnailInteractor_; - LayoutWidget* mainLayout_; - LayoutWidget* thumbnailsLayout_; - std::vector thumbnails_; - std::map> instancesIdsPerSeriesId_; + Tools currentTool_; + std::auto_ptr mainWidgetInteractor_; + std::auto_ptr thumbnailInteractor_; + LayoutWidget* mainLayout_; + LayoutWidget* thumbnailsLayout_; + std::vector thumbnails_; + + std::map > instancesIdsPerSeriesId_; std::map seriesTags_; - unsigned int currentInstanceIndex_; - OrthancStone::WidgetViewport* wasmViewport1_; - OrthancStone::WidgetViewport* wasmViewport2_; + unsigned int currentInstanceIndex_; + OrthancStone::WidgetViewport* wasmViewport1_; + OrthancStone::WidgetViewport* wasmViewport2_; - IStatusBar* statusBar_; - std::unique_ptr smartLoader_; - std::unique_ptr orthancApiClient_; + IStatusBar* statusBar_; + std::auto_ptr smartLoader_; + std::auto_ptr orthancApiClient_; public: SimpleViewerApplication(MessageBroker& broker) : diff -r 08683537a227 -r c34784e5f299 Applications/Samples/SingleFrameApplication.h --- a/Applications/Samples/SingleFrameApplication.h Wed Oct 17 19:42:56 2018 +0200 +++ b/Applications/Samples/SingleFrameApplication.h Thu Oct 18 09:02:24 2018 +0200 @@ -184,11 +184,10 @@ mainWidget_->FitContent(); } - std::unique_ptr mainWidgetInteractor_; - std::unique_ptr orthancApiClient_; - - const OrthancFrameLayerSource* source_; - unsigned int slice_; + std::auto_ptr mainWidgetInteractor_; + std::auto_ptr orthancApiClient_; + const OrthancFrameLayerSource* source_; + unsigned int slice_; public: SingleFrameApplication(MessageBroker& broker) : diff -r 08683537a227 -r c34784e5f299 Applications/Samples/SingleFrameEditorApplication.h --- a/Applications/Samples/SingleFrameEditorApplication.h Wed Oct 17 19:42:56 2018 +0200 +++ b/Applications/Samples/SingleFrameEditorApplication.h Thu Oct 18 09:02:24 2018 +0200 @@ -157,12 +157,11 @@ mainWidget_->FitContent(); } - std::unique_ptr mainWidgetInteractor_; - std::unique_ptr orthancApiClient_; - Tools currentTool_; - - const OrthancFrameLayerSource* source_; - unsigned int slice_; + std::auto_ptr mainWidgetInteractor_; + std::auto_ptr orthancApiClient_; + Tools currentTool_; + const OrthancFrameLayerSource* source_; + unsigned int slice_; public: SingleFrameEditorApplication(MessageBroker& broker) : diff -r 08683537a227 -r c34784e5f299 Framework/SmartLoader.cpp --- a/Framework/SmartLoader.cpp Wed Oct 17 19:42:56 2018 +0200 +++ b/Framework/SmartLoader.cpp Thu Oct 18 09:02:24 2018 +0200 @@ -30,12 +30,12 @@ namespace OrthancStone { - enum CachedSliceStatus - { - CachedSliceStatus_ScheduledToLoad, - CachedSliceStatus_GeometryLoaded, - CachedSliceStatus_ImageLoaded - }; + enum CachedSliceStatus + { + CachedSliceStatus_ScheduledToLoad, + CachedSliceStatus_GeometryLoaded, + CachedSliceStatus_ImageLoaded + }; class SmartLoader::CachedSlice : public LayerSourceBase { @@ -47,11 +47,14 @@ CachedSliceStatus status_; public: + CachedSlice(MessageBroker& broker) : + LayerSourceBase(broker) + { + } - CachedSlice(MessageBroker& broker) - : LayerSourceBase(broker) - {} - virtual ~CachedSlice() {} + virtual ~CachedSlice() + { + } virtual bool GetExtent(std::vector& points, const CoordinateSystem3D& viewportSlice) @@ -97,7 +100,8 @@ }; - SmartLoader::SmartLoader(MessageBroker& broker, OrthancApiClient& orthancApiClient) : + SmartLoader::SmartLoader(MessageBroker& broker, + OrthancApiClient& orthancApiClient) : IObservable(broker), IObserver(broker), imageQuality_(SliceImageQuality_FullPam), @@ -105,7 +109,10 @@ { } - void SmartLoader::SetFrameInWidget(LayerWidget& layerWidget, size_t layerIndex, const std::string& instanceId, unsigned int frame) + void SmartLoader::SetFrameInWidget(LayerWidget& layerWidget, + size_t layerIndex, + const std::string& instanceId, + unsigned int frame) { // TODO: check if this frame has already been loaded or is already being loaded. // - if already loaded: create a "clone" that will emit the GeometryReady/ImageReady messages "immediately" @@ -115,7 +122,7 @@ // in both cases, we must be carefull about objects lifecycle !!! std::auto_ptr layerSource; - std::string sliceKeyId = instanceId + ":" + std::to_string(frame); + std::string sliceKeyId = instanceId + ":" + boost::lexical_cast(frame); SmartLoader::CachedSlice* cachedSlice = NULL; if (cachedSlices_.find(sliceKeyId) != cachedSlices_.end()) // && cachedSlices_[sliceKeyId]->status_ == CachedSliceStatus_Loaded) @@ -154,7 +161,8 @@ } - void SmartLoader::PreloadSlice(const std::string instanceId, unsigned int frame) + void SmartLoader::PreloadSlice(const std::string instanceId, + unsigned int frame) { // TODO: reactivate -> need to be able to ScheduleLayerLoading in ILayerSource without calling ScheduleLayerCreation return; @@ -166,7 +174,7 @@ boost::shared_ptr cachedSlice(new CachedSlice(IObserver::broker_)); cachedSlice->slice_.reset(new Slice(instanceId, frame)); cachedSlice->status_ = CachedSliceStatus_ScheduledToLoad; - std::string sliceKeyId = instanceId + ":" + std::to_string(frame); + std::string sliceKeyId = instanceId + ":" + boost::lexical_cast(frame); LOG(WARNING) << "Will preload: " << sliceKeyId; @@ -202,7 +210,8 @@ // save/replace the slice in cache const Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount() - std::string sliceKeyId = slice.GetOrthancInstanceId() + ":" + std::to_string(slice.GetFrame()); + std::string sliceKeyId = (slice.GetOrthancInstanceId() + ":" + + boost::lexical_cast(slice.GetFrame())); LOG(WARNING) << "Geometry ready: " << sliceKeyId; @@ -217,13 +226,15 @@ EmitMessage(message); } + void SmartLoader::OnImageReady(const ILayerSource::ImageReadyMessage& message) { OrthancFrameLayerSource& source = dynamic_cast(message.origin_); // save/replace the slice in cache const Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount() ? - std::string sliceKeyId = slice.GetOrthancInstanceId() + ":" + std::to_string(slice.GetFrame()); + std::string sliceKeyId = (slice.GetOrthancInstanceId() + ":" + + boost::lexical_cast(slice.GetFrame())); LOG(WARNING) << "Image ready: " << sliceKeyId; @@ -239,11 +250,13 @@ EmitMessage(message); } + void SmartLoader::OnLayerReady(const ILayerSource::LayerReadyMessage& message) { OrthancFrameLayerSource& source = dynamic_cast(message.origin_); const Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount() ? - std::string sliceKeyId = slice.GetOrthancInstanceId() + ":" + std::to_string(slice.GetFrame()); + std::string sliceKeyId = (slice.GetOrthancInstanceId() + ":" + + boost::lexical_cast(slice.GetFrame())); LOG(WARNING) << "Layer ready: " << sliceKeyId; @@ -256,5 +269,4 @@ // re-emit original Layer message to observers EmitMessage(message); } - } diff -r 08683537a227 -r c34784e5f299 Framework/SmartLoader.h --- a/Framework/SmartLoader.h Wed Oct 17 19:42:56 2018 +0200 +++ b/Framework/SmartLoader.h Thu Oct 18 09:02:24 2018 +0200 @@ -35,10 +35,10 @@ class CachedSlice; protected: - typedef std::map> CachedSlices; + typedef std::map > CachedSlices; CachedSlices cachedSlices_; - typedef std::map> PreloadingInstances; + typedef std::map > PreloadingInstances; PreloadingInstances preloadingInstances_; SliceImageQuality imageQuality_; diff -r 08683537a227 -r c34784e5f299 Framework/Toolbox/OrthancApiClient.cpp --- a/Framework/Toolbox/OrthancApiClient.cpp Wed Oct 17 19:42:56 2018 +0200 +++ b/Framework/Toolbox/OrthancApiClient.cpp Thu Oct 18 09:02:24 2018 +0200 @@ -36,8 +36,10 @@ // TODO: handle destruction of this object (with shared_ptr ?::delete_later ???) class HttpResponseToJsonConverter : public IObserver, IObservable { - std::auto_ptr> orthancApiSuccessCallback_; - std::auto_ptr> orthancApiFailureCallback_; + private: + std::auto_ptr > orthancApiSuccessCallback_; + std::auto_ptr > orthancApiFailureCallback_; + public: HttpResponseToJsonConverter(MessageBroker& broker, MessageHandler* orthancApiSuccessCallback, @@ -82,8 +84,10 @@ // TODO: handle destruction of this object (with shared_ptr ?::delete_later ???) class HttpResponseToBinaryConverter : public IObserver, IObservable { - std::auto_ptr> orthancApiSuccessCallback_; - std::auto_ptr> orthancApiFailureCallback_; + private: + std::auto_ptr > orthancApiSuccessCallback_; + std::auto_ptr > orthancApiFailureCallback_; + public: HttpResponseToBinaryConverter(MessageBroker& broker, MessageHandler* orthancApiSuccessCallback, @@ -124,8 +128,10 @@ // TODO: handle destruction of this object (with shared_ptr ?::delete_later ???) class HttpResponseToEmptyConverter : public IObserver, IObservable { - std::auto_ptr> orthancApiSuccessCallback_; - std::auto_ptr> orthancApiFailureCallback_; + private: + std::auto_ptr > orthancApiSuccessCallback_; + std::auto_ptr > orthancApiFailureCallback_; + public: HttpResponseToEmptyConverter(MessageBroker& broker, MessageHandler* orthancApiSuccessCallback, diff -r 08683537a227 -r c34784e5f299 Framework/Toolbox/OrthancSlicesLoader.cpp --- a/Framework/Toolbox/OrthancSlicesLoader.cpp Wed Oct 17 19:42:56 2018 +0200 +++ b/Framework/Toolbox/OrthancSlicesLoader.cpp Thu Oct 18 09:02:24 2018 +0200 @@ -552,7 +552,7 @@ (new Orthanc::Image(expectedFormat, reader->GetWidth(), reader->GetHeight(), false)); Orthanc::ImageProcessing::Convert(*image, *reader); - reader = NULL; + reader.reset(); float scaling = static_cast(stretchHigh - stretchLow) / 255.0f; diff -r 08683537a227 -r c34784e5f299 Platforms/Generic/WebServiceCommandBase.h --- a/Platforms/Generic/WebServiceCommandBase.h Wed Oct 17 19:42:56 2018 +0200 +++ b/Platforms/Generic/WebServiceCommandBase.h Thu Oct 18 09:02:24 2018 +0200 @@ -37,8 +37,8 @@ class WebServiceCommandBase : public IOracleCommand, IObservable { protected: - std::auto_ptr> successCallback_; - std::auto_ptr> failureCallback_; + std::auto_ptr > successCallback_; + std::auto_ptr > failureCallback_; Orthanc::WebServiceParameters parameters_; std::string uri_; std::map headers_;