libtasks Documentation  1.6
uwsgi_thrift_transport.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_TRANSPORT_H_
9 #define _UWSGI_THRIFT_TRANSPORT_H_
10 
11 #include <thrift/transport/TVirtualTransport.h>
12 
13 namespace tasks {
14 namespace net {
15 
16 template <class T>
17 class uwsgi_thrift_transport : public apache::thrift::transport::TVirtualTransport<uwsgi_thrift_transport<T> > {
18  public:
21 
22  uint32_t read(uint8_t* data, int32_t size) { return m_uwsgi_obj->read((char*)data, size); }
23 
24  void write(const uint8_t* data, uint32_t size) { m_uwsgi_obj->write((const char*)data, size); }
25 
26  void flush() {}
27 
28  private:
30 };
31 
32 } // net
33 } // tasks
34 
35 #endif // _UWSGI_THRIFT_TRANSPORT_H_
uint32_t read(uint8_t *data, int32_t size)
void write(const uint8_t *data, uint32_t size)