alaCarte Maps
Renderer for OpenStreetMap tiles
HttpRequest Class Reference

#include <http_request.hpp>

Inheritance diagram for HttpRequest:

Classes

struct  Header
 
class  Reply
 
struct  RequestData
 

Public Member Functions

 HttpRequest (boost::asio::io_service &ioService, const shared_ptr< HttpServer > &server, const shared_ptr< RequestManager > &manager)
 This file is part of alaCarte. More...
 
TESTABLE const stringgetURL () const
 
TESTABLE void answer (const shared_ptr< Tile > &tile, Reply::StatusType status=Reply::ok)
 
TESTABLE void answer (Reply::StatusType status)
 
void startCollectingData ()
 Start the first asynchronous operation for the connection. More...
 
void close ()
 Stop all asynchronous operations associated with the connection. More...
 
boost::asio::ip::tcp::socket & getSocket ()
 

Protected Attributes

bool answered
 
Reply reply
 The reply to be sent back to the client. More...
 
RequestData data
 

Private Member Functions

void handleRead (const boost::system::error_code &e, std::size_t bytes_transferred)
 Handle completion of a read operation. More...
 
void handleWrite (const boost::system::error_code &e)
 Handle completion of a write operation. More...
 
void answer ()
 
bool checkifAnswered ()
 
void readSome ()
 

Private Attributes

boost::asio::ip::tcp::socket socket
 Socket for the connection. More...
 
std::array< char, 8192 > buffer
 Buffer for incoming data. More...
 
HttpRequestParser parser
 The parser for the incoming request. More...
 
weak_ptr< RequestManagermanager
 
weak_ptr< HttpServerserver
 

Friends

class HttpRequestParser
 

Detailed Description

Definition at line 33 of file http_request.hpp.

Constructor & Destructor Documentation

HttpRequest::HttpRequest ( boost::asio::io_service &  ioService,
const shared_ptr< HttpServer > &  server,
const shared_ptr< RequestManager > &  manager 
)
explicit

This file is part of alaCarte.

alaCarte is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

alaCarte is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with alaCarte. If not, see http://www.gnu.org/licenses/.

Copyright alaCarte 2012-2013 Simon Dreher, Florian Jacob, Tobias Kahlert, Patrick Niklaus, Bernhard Scheirle, Lisa Winter Maintainer: Bernhard Scheirle

Definition at line 31 of file http_request.cpp.

Member Function Documentation

void HttpRequest::answer ( const shared_ptr< Tile > &  tile,
Reply::StatusType  status = Reply::ok 
)

Definition at line 132 of file http_request.cpp.

void HttpRequest::answer ( Reply::StatusType  status)

Definition at line 124 of file http_request.cpp.

void HttpRequest::answer ( )
private

Definition at line 116 of file http_request.cpp.

bool HttpRequest::checkifAnswered ( )
private

Definition at line 108 of file http_request.cpp.

void HttpRequest::close ( )

Stop all asynchronous operations associated with the connection.

Definition at line 45 of file http_request.cpp.

boost::asio::ip::tcp::socket & HttpRequest::getSocket ( )

Definition at line 103 of file http_request.cpp.

const string & HttpRequest::getURL ( ) const

Definition at line 98 of file http_request.cpp.

void HttpRequest::handleRead ( const boost::system::error_code &  e,
std::size_t  bytes_transferred 
)
private

Handle completion of a read operation.

Definition at line 58 of file http_request.cpp.

void HttpRequest::handleWrite ( const boost::system::error_code &  e)
private

Handle completion of a write operation.

Definition at line 82 of file http_request.cpp.

void HttpRequest::readSome ( )
private

Definition at line 49 of file http_request.cpp.

void HttpRequest::startCollectingData ( )

Start the first asynchronous operation for the connection.

Definition at line 40 of file http_request.cpp.

Friends And Related Function Documentation

friend class HttpRequestParser
friend

Definition at line 35 of file http_request.hpp.

Member Data Documentation

bool HttpRequest::answered
protected

Definition at line 112 of file http_request.hpp.

std::array<char, 8192> HttpRequest::buffer
private

Buffer for incoming data.

Definition at line 121 of file http_request.hpp.

RequestData HttpRequest::data
protected

Definition at line 115 of file http_request.hpp.

weak_ptr<RequestManager> HttpRequest::manager
private

Definition at line 125 of file http_request.hpp.

HttpRequestParser HttpRequest::parser
private

The parser for the incoming request.

Definition at line 123 of file http_request.hpp.

Reply HttpRequest::reply
protected

The reply to be sent back to the client.

Definition at line 114 of file http_request.hpp.

weak_ptr<HttpServer> HttpRequest::server
private

Definition at line 126 of file http_request.hpp.

boost::asio::ip::tcp::socket HttpRequest::socket
private

Socket for the connection.

Definition at line 119 of file http_request.hpp.


The documentation for this class was generated from the following files: