diff Core/RestApi/RestApiHierarchy.h @ 975:c550e99c452b

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 30 Jun 2014 14:53:18 +0200
parents 83622b0f544c
children ce3106e5843f
line wrap: on
line diff
--- a/Core/RestApi/RestApiHierarchy.h	Mon Jun 30 14:44:05 2014 +0200
+++ b/Core/RestApi/RestApiHierarchy.h	Mon Jun 30 14:53:18 2014 +0200
@@ -32,12 +32,10 @@
 
 #pragma once
 
-#include "RestApi.h"
-
-#include "../OrthancException.h"
-
-#include <list>
-#include <set>
+#include "RestApiGetCall.h"
+#include "RestApiPostCall.h"
+#include "RestApiPutCall.h"
+#include "RestApiDeleteCall.h"
 
 namespace Orthanc
 {
@@ -47,9 +45,9 @@
     class Handlers
     {
     private:
-      RestApiGetCall::Handler  getHandler_;
-      RestApiPostCall::Handler  postHandler_;
-      RestApiPutCall::Handler  putHandler_;
+      RestApiGetCall::Handler     getHandler_;
+      RestApiPostCall::Handler    postHandler_;
+      RestApiPutCall::Handler     putHandler_;
       RestApiDeleteCall::Handler  deleteHandler_;
 
     public:
@@ -92,7 +90,7 @@
     typedef std::map<std::string, RestApiHierarchy*>  Children;
     typedef bool (*ResourceCallback) (Handlers& handlers,
                                       const UriComponents& uri,
-                                      const RestApiPath::Components& components,
+                                      const HttpHandler::Arguments& components,
                                       const UriComponents& trailing,
                                       void* call);
 
@@ -112,7 +110,7 @@
                           Handler handler,
                           size_t level);
 
-    bool LookupHandler(RestApiPath::Components& components,
+    bool LookupHandler(HttpHandler::Arguments& components,
                        const UriComponents& uri,
                        ResourceCallback callback,
                        size_t level,
@@ -124,25 +122,25 @@
                      
     static bool GetCallback(Handlers& handlers,
                             const UriComponents& uri,
-                            const RestApiPath::Components& components,
+                            const HttpHandler::Arguments& components,
                             const UriComponents& trailing,
                             void* call);
 
     static bool PostCallback(Handlers& handlers,
                              const UriComponents& uri,
-                             const RestApiPath::Components& components,
+                             const HttpHandler::Arguments& components,
                              const UriComponents& trailing,
                              void* call);
 
     static bool PutCallback(Handlers& handlers,
                             const UriComponents& uri,
-                            const RestApiPath::Components& components,
+                            const HttpHandler::Arguments& components,
                             const UriComponents& trailing,
                             void* call);
 
     static bool DeleteCallback(Handlers& handlers,
                                const UriComponents& uri,
-                               const RestApiPath::Components& components,
+                               const HttpHandler::Arguments& components,
                                const UriComponents& trailing,
                                void* call);