diff OrthancServer/OrthancConfiguration.h @ 2940:4767d36679ed

refactoring access to Orthanc configuration
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 29 Nov 2018 11:47:00 +0100
parents 4a38d7d4f0e0
children e292798f9980
line wrap: on
line diff
--- a/OrthancServer/OrthancConfiguration.h	Wed Nov 28 14:48:14 2018 +0100
+++ b/OrthancServer/OrthancConfiguration.h	Thu Nov 29 11:47:00 2018 +0100
@@ -41,6 +41,7 @@
 
 #include <boost/filesystem.hpp>
 #include <boost/thread/shared_mutex.hpp>
+#include <boost/thread/lock_types.hpp>
 
 namespace Orthanc
 {
@@ -66,14 +67,14 @@
     static OrthancConfiguration& GetInstance();
 
   public:
-    class Reader : public boost::noncopyable
+    class ReaderLock : public boost::noncopyable
     {
     private:
       OrthancConfiguration&                    configuration_;
       boost::shared_lock<boost::shared_mutex>  lock_;
 
     public:
-      Reader() :
+      ReaderLock() :
         configuration_(GetInstance()),
         lock_(configuration_.mutex_)
       {
@@ -91,14 +92,14 @@
     };
 
 
-    class Writer : public boost::noncopyable
+    class WriterLock : public boost::noncopyable
     {
     private:
       OrthancConfiguration&                    configuration_;
       boost::unique_lock<boost::shared_mutex>  lock_;
 
     public:
-      Writer() :
+      WriterLock() :
         configuration_(GetInstance()),
         lock_(configuration_.mutex_)
       {
@@ -121,11 +122,6 @@
     };
 
 
-    const Json::Value& GetContent() const
-    {
-      return json_;
-    }
-
     const std::string& GetConfigurationAbsolutePath() const
     {
       return configurationAbsolutePath_;
@@ -173,8 +169,8 @@
 
     std::string InterpretStringParameterAsPath(const std::string& parameter) const;
     
-    void GetGlobalListOfStringsParameter(std::list<std::string>& target,
-                                         const std::string& key) const;
+    void GetListOfStringsParameter(std::list<std::string>& target,
+                                   const std::string& key) const;
     
     bool IsSameAETitle(const std::string& aet1,
                        const std::string& aet2) const;