changeset 29:e53daed19d97

Creation of the IHeaderHandler and IBodyHandler interfaces.
author Zoltan K
date Sun, 21 Mar 2010 15:27:01 +0100
parents 6ad68d5cb049
children ed7e54a1bc3d
files src/examples/rot13/Rot13Handler.hpp src/include/handler/IBodyHandler.hpp src/include/handler/IHeaderHandler.hpp src/include/handler/IHttpHandler.hpp
diffstat 4 files changed, 84 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/src/examples/rot13/Rot13Handler.hpp	Sun Mar 21 15:19:01 2010 +0100
+++ b/src/examples/rot13/Rot13Handler.hpp	Sun Mar 21 15:27:01 2010 +0100
@@ -4,7 +4,7 @@
 # include <ostream>
 # include <istream>
 
-# include "handler/IHttpHandler.hpp"
+# include "handler/IBodyHandler.hpp"
 
 /**
  ** @brief Function that convert a char to its rot13 value
@@ -16,7 +16,7 @@
 /**
  ** @brief this class is an simple implementation of the StreamIt IHttpHandler interface
  */
-class   Rot13Handler : public zia::api::handler::IHttpHandler
+class   Rot13Handler : public zia::api::handler::IBodyHandler
 {
 public:
     virtual ~Rot13Handler(void) { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/include/handler/IBodyHandler.hpp	Sun Mar 21 15:27:01 2010 +0100
@@ -0,0 +1,42 @@
+#ifndef __ZIA_API_HANDLER_IBODYHANDLER_HPP__
+# define __ZIA_API_HANDLER_IBODYHANDLER_HPP__
+
+# include <iostream>
+
+# include "http/ITransaction.hpp"
+# include "handler/IHandler.hpp"
+
+namespace       zia
+{
+
+namespace       api
+{
+
+namespace       handler
+{
+
+class   IBodyHandler : public IHandler
+{
+public:
+
+    virtual ~IBodyHandler(void) { }
+
+    /**
+     * @brief method called by the server.
+     * @param [in] transac the transation associated with streams.
+     * @param [in] is the input stream
+     * @param [in] os the output stream
+     * @return an integer TODO define an enum XXX
+     * @see ITransaction
+     */
+    virtual int     operator()(zia::api::http::ITransaction & transac, std::istream & is, std::ostream & os) = 0;
+
+};
+
+}
+
+}
+
+}
+
+#endif	/* ! __ZIA_API_HANDLER_IBODYHANDLER_HPP__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/include/handler/IHeaderHandler.hpp	Sun Mar 21 15:27:01 2010 +0100
@@ -0,0 +1,40 @@
+#ifndef __ZIA_API_HANDLER_IHEADERHANDLER_HPP__
+# define __ZIA_API_HANDLER_IHEADERHANDLER_HPP__
+
+# include <iostream>
+
+# include "http/ITransaction.hpp"
+# include "handler/IHandler.hpp"
+
+namespace       zia
+{
+
+namespace       api
+{
+
+namespace       handler
+{
+
+class   IHeaderHandler : public IHandler
+{
+public:
+
+    virtual ~IHeaderHandler(void) { }
+
+    /**
+     ** @brief method called by the server.
+     ** @param [in] transac the transation associated with streams.
+     ** @return an integer TODO define an enum XXX
+     ** @see ITransaction
+     */
+    virtual int     operator()(zia::api::http::ITransaction & transac) = 0;
+
+};
+
+}
+
+}
+
+}
+
+#endif	/* ! __ZIA_API_HANDLER_IHEADERHANDLER_HPP__ */
--- a/src/include/handler/IHttpHandler.hpp	Sun Mar 21 15:19:01 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-#ifndef __ZIA_API_HANDLER_INETWORKHANDLER_HPP__
-# define __ZIA_API_HANDLER_INETWORKHANDLER_HPP__
-
-# include <iostream>
-
-# include "http/ITransaction.hpp"
-# include "handler/IHandler.hpp"
-
-namespace       zia
-{
-
-namespace       api
-{
-
-namespace       handler
-{
-
-class   IHttpHandler : public IHandler
-{
-public:
-
-    virtual ~IHttpHandler(void) { }
-
-    /**
-     * @brief method called by the server.
-     * @param [in] transac the transation associated with streams.
-     * @param [in] is the input stream
-     * @param [in] os the output stream
-     * @return an integer TODO define an enum XXX
-     * @see ITransaction
-     */
-    virtual int     operator()(zia::api::http::ITransaction & transac, std::istream & is, std::ostream & os) = 0;
-
-};
-
-}
-
-}
-
-}
-
-#endif	/* ! __ZIA_API_HANDLER_INETWORKHANDLER_HPP__ */