libtasks Documentation  1.6
uwsgi_thrift_handler.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014 ADTECH GmbH
3  * Licensed under MIT (https://github.com/adtechlabs/libtasks/blob/master/COPYING)
4  *
5  * Author: Andreas Pohl
6  */
7 
8 #ifndef _UWSGI_THRIFT_HANDLER_H_
9 #define _UWSGI_THRIFT_HANDLER_H_
10 
11 #include <tasks/net/uwsgi_task.h>
12 #include <string>
13 #include <functional>
14 
15 namespace tasks {
16 namespace net {
17 
18 template <class thrift_interface_type>
19 class uwsgi_thrift_handler : public thrift_interface_type {
20  public:
21  inline void set_uwsgi_task(uwsgi_task* t) { m_uwsgi_task = t; }
22 
23  protected:
24  // Provide some wrappers to access the request and response structures
25  // from a service call implementation.
26  inline const uwsgi_request& request() const { return m_uwsgi_task->request(); }
27 
28  inline const uwsgi_request* request_p() const { return m_uwsgi_task->request_p(); }
29 
30  inline http_response& response() { return m_uwsgi_task->response(); }
31 
33 
34  private:
36 };
37 
38 } // net
39 } // tasks
40 
41 #endif // _UWSGI_THRIFT_HANDLER_H_
The HTTP response implementation.
Definition: http_response.h:19
http_response & response()
Definition: uwsgi_task.h:55
uwsgi_request * request_p()
Definition: uwsgi_task.h:49
The base class for the uwsgi protocol implementation.
Definition: uwsgi_task.h:30
const uwsgi_request & request() const
The uwsgi protocol implementation for a request. The response is a HTTP/1.1 response.
Definition: uwsgi_request.h:27
http_response * response_p()
Definition: uwsgi_task.h:61
uwsgi_request & request()
Definition: uwsgi_task.h:43
const uwsgi_request * request_p() const