diff Core/HttpServer/MongooseServer.h @ 1443:895ab369d63c

refactoring: OrthancHttpHandler
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Jul 2015 11:30:19 +0200
parents f3672356c121
children 4f8c8ef114db
line wrap: on
line diff
--- a/Core/HttpServer/MongooseServer.h	Wed Jul 01 11:08:23 2015 +0200
+++ b/Core/HttpServer/MongooseServer.h	Wed Jul 01 11:30:19 2015 +0200
@@ -59,15 +59,12 @@
 
   class MongooseServer
   {
-  public:
-    typedef std::list<IHttpHandler*> Handlers;
-
   private:
     // http://stackoverflow.com/questions/311166/stdauto-ptr-or-boostshared-ptr-for-pimpl-idiom
     struct PImpl;
     boost::shared_ptr<PImpl> pimpl_;
 
-    Handlers handlers_;
+    IHttpHandler *handler_;
 
     typedef std::set<std::string> RegisteredUsers;
     RegisteredUsers registeredUsers_;
@@ -103,8 +100,6 @@
     void RegisterUser(const char* username,
                       const char* password);
 
-    void RegisterHandler(IHttpHandler& handler);
-
     bool IsAuthenticationEnabled() const
     {
       return authentication_;
@@ -147,15 +142,17 @@
 
     void SetIncomingHttpRequestFilter(IIncomingHttpRequestFilter& filter);
 
-    void ClearHandlers();
-
     ChunkStore& GetChunkStore();
 
     bool IsValidBasicHttpAuthentication(const std::string& basic) const;
 
-    const Handlers& GetHandlers() const
+    void Register(IHttpHandler& handler);
+
+    bool HasHandler() const
     {
-      return handlers_;
+      return handler_ != NULL;
     }
+
+    IHttpHandler& GetHandler() const;
   };
 }