Mercurial > hg > orthanc-stone
diff Applications/BasicApplicationContext.h @ 222:84844649a8fd am
continued: reusable applications
author | am@osimis.io |
---|---|
date | Tue, 12 Jun 2018 17:21:15 +0200 |
parents | d7b2590744f8 |
children | 5027cb2feb51 |
line wrap: on
line diff
--- a/Applications/BasicApplicationContext.h Mon Jun 11 14:01:02 2018 +0200 +++ b/Applications/BasicApplicationContext.h Tue Jun 12 17:21:15 2018 +0200 @@ -21,71 +21,22 @@ #pragma once +#include "../Platforms/Generic/OracleWebService.h" #include "../Framework/Viewport/WidgetViewport.h" -#include "../Framework/Volumes/ISlicedVolume.h" -#include "../Framework/Volumes/IVolumeLoader.h" -#include "../Framework/Widgets/IWorldSceneInteractor.h" -#include "../Platforms/Generic/OracleWebService.h" #include <list> -#include <boost/thread.hpp> namespace OrthancStone { class BasicApplicationContext : public boost::noncopyable { - private: - - static void UpdateThread(BasicApplicationContext* that); - - - Oracle oracle_; - OracleWebService webService_; - boost::mutex viewportMutex_; - WidgetViewport centralViewport_; - boost::thread updateThread_; - bool stopped_; - unsigned int updateDelay_; public: - class ViewportLocker : public boost::noncopyable - { - private: - boost::mutex::scoped_lock lock_; - IViewport& viewport_; + BasicApplicationContext() {} - public: - ViewportLocker(BasicApplicationContext& that) : - lock_(that.viewportMutex_), - viewport_(that.centralViewport_) - { - } - - IViewport& GetViewport() const - { - return viewport_; - } - }; - - - BasicApplicationContext(Orthanc::WebServiceParameters& orthanc); + virtual IWebService& GetWebService() = 0; + virtual IWidget& SetCentralWidget(IWidget* widget) = 0; // Takes ownership virtual ~BasicApplicationContext() {} - - IWidget& SetCentralWidget(IWidget* widget); // Takes ownership - - IWebService& GetWebService() - { - return webService_; - } - - void Start(); - - void Stop(); - - void SetUpdateDelay(unsigned int delay) // In milliseconds - { - updateDelay_ = delay; - } }; }