PixelLightAPI  .
HttpServer.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: HttpServer.h                                   *
00003  *
00004  *  Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLCORE_HTTPSERVER_H__
00024 #define __PLCORE_HTTPSERVER_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLCore/Network/Server.h"
00032 #include "PLCore/Network/Http/Http.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLCore {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Forward declarations                                  ]
00043 //[-------------------------------------------------------]
00044 class HttpHeader;
00045 class HttpServerConnection;
00046 
00047 
00048 //[-------------------------------------------------------]
00049 //[ Classes                                               ]
00050 //[-------------------------------------------------------]
00051 /**
00052 *  @brief
00053 *    Http server
00054 */
00055 class HttpServer : public Server {
00056 
00057 
00058     //[-------------------------------------------------------]
00059     //[ Friends                                               ]
00060     //[-------------------------------------------------------]
00061     friend class HttpServerConnection;
00062 
00063 
00064     //[-------------------------------------------------------]
00065     //[ Public functions                                      ]
00066     //[-------------------------------------------------------]
00067     public:
00068         /**
00069         *  @brief
00070         *    Constructor
00071         */
00072         PLCORE_API HttpServer();
00073 
00074         /**
00075         *  @brief
00076         *    Destructor
00077         */
00078         PLCORE_API virtual ~HttpServer();
00079 
00080 
00081     //[-------------------------------------------------------]
00082     //[ Protected virtual HttpServer functions                ]
00083     //[-------------------------------------------------------]
00084     protected:
00085         /**
00086         *  @brief
00087         *    A web server request has come in
00088         *
00089         *  @param[in] pConnection
00090         *    Connection
00091         *  @param[in] pHeader
00092         *    HTTP header
00093         */
00094         PLCORE_API virtual void OnRequest(HttpServerConnection *pConnection, const HttpHeader *pHeader);
00095 
00096         /**
00097         *  @brief
00098         *    A GET request has come in
00099         *
00100         *  @param[in] pConnection
00101         *    Connection
00102         *  @param[in] pHeader
00103         *    HTTP header
00104         */
00105         PLCORE_API virtual void OnGet(HttpServerConnection *pConnection, const HttpHeader *pHeader);
00106 
00107         /**
00108         *  @brief
00109         *    An error occurred
00110         *
00111         *  @param[in] pConnection
00112         *    Connection
00113         *  @param[in] nStatus
00114         *    HTTP status code
00115         */
00116         PLCORE_API virtual void OnError(HttpServerConnection *pConnection, EHttpStatus nStatus);
00117 
00118 
00119     //[-------------------------------------------------------]
00120     //[ Protected virtual Server functions                    ]
00121     //[-------------------------------------------------------]
00122     protected:
00123         PLCORE_API virtual Connection *CreateIncomingConnection() override;
00124         PLCORE_API virtual void OnConnect(Connection &cConnection) override;
00125         PLCORE_API virtual void OnDisconnect(Connection &cConnection) override;
00126 
00127 
00128     //[-------------------------------------------------------]
00129     //[ Private functions                                     ]
00130     //[-------------------------------------------------------]
00131     private:
00132         /**
00133         *  @brief
00134         *    Copy constructor
00135         *
00136         *  @param[in] cServer
00137         *    HTTP server
00138         */
00139         HttpServer(const HttpServer &cServer);
00140 
00141         /**
00142         *  @brief
00143         *    Copy operator
00144         *
00145         *  @param[in] cHttpServer
00146         *    HTTP server
00147         *
00148         *  @return
00149         *    Reference to this server
00150         */
00151         HttpServer &operator =(const HttpServer &cServer);
00152 
00153 
00154 };
00155 
00156 
00157 //[-------------------------------------------------------]
00158 //[ Namespace                                             ]
00159 //[-------------------------------------------------------]
00160 } // PLCore
00161 
00162 
00163 #endif // __PLCORE_HTTPSERVER_H__


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:50:56
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported