diff Applications/StoneApplicationContext.h @ 418:c23df8b3433b

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 15 Nov 2018 18:32:48 +0100
parents aee3d7941c9b
children 26b90b110719 b70e9be013e4
line wrap: on
line diff
--- a/Applications/StoneApplicationContext.h	Thu Nov 15 17:28:15 2018 +0100
+++ b/Applications/StoneApplicationContext.h	Thu Nov 15 18:32:48 2018 +0100
@@ -38,14 +38,17 @@
 
   class StoneApplicationContext : public boost::noncopyable
   {
-  protected:
-    // TODO ADD THE MessageBroker HERE
-    
+  private:
+    MessageBroker&                   broker_;
     IWebService*                     webService_;
     std::auto_ptr<OrthancApiClient>  orthanc_;
+    std::string                      orthancBaseUrl_;
+
+    void InitializeOrthanc();
 
   public:
-    StoneApplicationContext() :
+    StoneApplicationContext(MessageBroker& broker) :
+      broker_(broker),
       webService_(NULL)
     {
     }
@@ -54,12 +57,22 @@
     {
     }
 
+    MessageBroker& GetMessageBroker()
+    {
+      return broker_;
+    }
+
+    bool HasWebService() const
+    {
+      return webService_ != NULL;
+    }
+
     IWebService& GetWebService();
 
     OrthancApiClient& GetOrthancApiClient();
 
-    void Initialize(MessageBroker& broker,
-                    IWebService& webService,
-                    const std::string& orthancBaseUrl);
+    void SetWebService(IWebService& webService);
+
+    void SetOrthancBaseUrl(const std::string& baseUrl);
   };
 }