blob: 37d0801606bcd742b4777d56cce42d63dceacdca [file] [log] [blame]
David Reissea2cba82009-03-30 21:35:00 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
Mark Slee9f0c6512007-02-28 23:58:26 +000019
Mark Sleef5f2be42006-09-05 21:05:31 +000020#ifndef _THRIFT_PROTOCOL_TPROTOCOL_H_
21#define _THRIFT_PROTOCOL_TPROTOCOL_H_ 1
Mark Sleee8540632006-05-30 09:24:40 +000022
Marc Slemko16698852006-08-04 03:16:10 +000023#include <transport/TTransport.h>
Mark Sleef9831082007-02-20 20:59:21 +000024#include <protocol/TProtocolException.h>
Marc Slemko16698852006-08-04 03:16:10 +000025
26#include <boost/shared_ptr.hpp>
27
Mark Slee8d7e1f62006-06-07 06:48:56 +000028#include <netinet/in.h>
Mark Sleee8540632006-05-30 09:24:40 +000029#include <sys/types.h>
30#include <string>
31#include <map>
32
T Jake Lucianib5e62212009-01-31 22:36:20 +000033namespace apache { namespace thrift { namespace protocol {
Marc Slemko6f038a72006-08-03 18:58:09 +000034
T Jake Lucianib5e62212009-01-31 22:36:20 +000035using apache::thrift::transport::TTransport;
Marc Slemko6f038a72006-08-03 18:58:09 +000036
Mark Slee4f261c52007-04-13 00:33:24 +000037#ifdef HAVE_ENDIAN_H
38#include <endian.h>
39#endif
40
Mark Slee1d2ead32007-06-09 01:23:04 +000041#ifndef __BYTE_ORDER
42# if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)
43# define __BYTE_ORDER BYTE_ORDER
44# define __LITTLE_ENDIAN LITTLE_ENDIAN
45# define __BIG_ENDIAN BIG_ENDIAN
46# else
47# error "Cannot determine endianness"
48# endif
49#endif
50
Mark Sleedc8a2a22006-09-19 22:20:18 +000051#if __BYTE_ORDER == __BIG_ENDIAN
Mark Slee4f261c52007-04-13 00:33:24 +000052# define ntohll(n) (n)
53# define htonll(n) (n)
54#elif __BYTE_ORDER == __LITTLE_ENDIAN
55# if defined(__GNUC__) && defined(__GLIBC__)
56# include <byteswap.h>
57# define ntohll(n) bswap_64(n)
58# define htonll(n) bswap_64(n)
59# else /* GNUC & GLIBC */
60# define ntohll(n) ( (((unsigned long long)ntohl(n)) << 32) + ntohl(n >> 32) )
61# define htonll(n) ( (((unsigned long long)htonl(n)) << 32) + htonl(n >> 32) )
62# endif /* GNUC & GLIBC */
63#else /* __BYTE_ORDER */
64# error "Can't define htonll or ntohll!"
Mark Sleedc8a2a22006-09-19 22:20:18 +000065#endif
Mark Slee8d7e1f62006-06-07 06:48:56 +000066
Mark Sleee8540632006-05-30 09:24:40 +000067/**
Mark Slee8d7e1f62006-06-07 06:48:56 +000068 * Enumerated definition of the types that the Thrift protocol supports.
69 * Take special note of the T_END type which is used specifically to mark
70 * the end of a sequence of fields.
71 */
72enum TType {
Marc Slemkod42a2c22006-08-10 03:30:18 +000073 T_STOP = 0,
Marc Slemko5b126d62006-08-11 23:03:42 +000074 T_VOID = 1,
75 T_BOOL = 2,
76 T_BYTE = 3,
Mark Sleecfc01932006-09-01 22:18:16 +000077 T_I08 = 3,
Marc Slemko5b126d62006-08-11 23:03:42 +000078 T_I16 = 6,
Marc Slemko5b126d62006-08-11 23:03:42 +000079 T_I32 = 8,
80 T_U64 = 9,
81 T_I64 = 10,
Mark Sleec98d0502006-09-06 02:42:25 +000082 T_DOUBLE = 4,
Marc Slemko5b126d62006-08-11 23:03:42 +000083 T_STRING = 11,
Marc Slemkod97eb612006-08-24 23:37:36 +000084 T_UTF7 = 11,
85 T_STRUCT = 12,
86 T_MAP = 13,
87 T_SET = 14,
88 T_LIST = 15,
89 T_UTF8 = 16,
90 T_UTF16 = 17
Mark Slee8d7e1f62006-06-07 06:48:56 +000091};
92
93/**
Mark Sleef5f2be42006-09-05 21:05:31 +000094 * Enumerated definition of the message types that the Thrift protocol
95 * supports.
Marc Slemko16698852006-08-04 03:16:10 +000096 */
97enum TMessageType {
98 T_CALL = 1,
Mark Sleef9831082007-02-20 20:59:21 +000099 T_REPLY = 2,
100 T_EXCEPTION = 3
Marc Slemko16698852006-08-04 03:16:10 +0000101};
102
103/**
Mark Sleee8540632006-05-30 09:24:40 +0000104 * Abstract class for a thrift protocol driver. These are all the methods that
105 * a protocol must implement. Essentially, there must be some way of reading
106 * and writing all the base types, plus a mechanism for writing out structs
Mark Slee5d06fea2007-03-05 22:18:18 +0000107 * with indexed fields.
108 *
109 * TProtocol objects should not be shared across multiple encoding contexts,
110 * as they may need to maintain internal state in some protocols (i.e. XML).
111 * Note that is is acceptable for the TProtocol module to do its own internal
112 * buffered reads/writes to the underlying TTransport where appropriate (i.e.
113 * when parsing an input XML stream, reading should be batched rather than
114 * looking ahead character by character for a close tag).
Mark Sleee8540632006-05-30 09:24:40 +0000115 *
Mark Sleee8540632006-05-30 09:24:40 +0000116 */
117class TProtocol {
118 public:
119 virtual ~TProtocol() {}
120
121 /**
Mark Slee8d7e1f62006-06-07 06:48:56 +0000122 * Writing functions.
Mark Sleee8540632006-05-30 09:24:40 +0000123 */
124
Mark Slee82a6c0f2007-04-04 21:08:21 +0000125 virtual uint32_t writeMessageBegin(const std::string& name,
126 const TMessageType messageType,
127 const int32_t seqid) = 0;
Marc Slemko16698852006-08-04 03:16:10 +0000128
Mark Slee4af6ed72006-10-25 19:02:49 +0000129 virtual uint32_t writeMessageEnd() = 0;
Marc Slemko16698852006-08-04 03:16:10 +0000130
131
David Reiss64120002008-04-29 23:12:24 +0000132 virtual uint32_t writeStructBegin(const char* name) = 0;
David Reiss0c90f6f2008-02-06 22:18:40 +0000133
Mark Slee4af6ed72006-10-25 19:02:49 +0000134 virtual uint32_t writeStructEnd() = 0;
David Reiss0c90f6f2008-02-06 22:18:40 +0000135
David Reiss64120002008-04-29 23:12:24 +0000136 virtual uint32_t writeFieldBegin(const char* name,
David Reiss96d23882007-07-26 21:10:32 +0000137 const TType fieldType,
138 const int16_t fieldId) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000139
Mark Slee4af6ed72006-10-25 19:02:49 +0000140 virtual uint32_t writeFieldEnd() = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000141
Mark Slee4af6ed72006-10-25 19:02:49 +0000142 virtual uint32_t writeFieldStop() = 0;
David Reiss0c90f6f2008-02-06 22:18:40 +0000143
Mark Slee4af6ed72006-10-25 19:02:49 +0000144 virtual uint32_t writeMapBegin(const TType keyType,
David Reiss96d23882007-07-26 21:10:32 +0000145 const TType valType,
146 const uint32_t size) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000147
Mark Slee4af6ed72006-10-25 19:02:49 +0000148 virtual uint32_t writeMapEnd() = 0;
David Reiss0c90f6f2008-02-06 22:18:40 +0000149
Mark Slee4af6ed72006-10-25 19:02:49 +0000150 virtual uint32_t writeListBegin(const TType elemType,
David Reiss96d23882007-07-26 21:10:32 +0000151 const uint32_t size) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000152
Mark Slee4af6ed72006-10-25 19:02:49 +0000153 virtual uint32_t writeListEnd() = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000154
Mark Slee4af6ed72006-10-25 19:02:49 +0000155 virtual uint32_t writeSetBegin(const TType elemType,
David Reiss96d23882007-07-26 21:10:32 +0000156 const uint32_t size) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000157
Mark Slee4af6ed72006-10-25 19:02:49 +0000158 virtual uint32_t writeSetEnd() = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000159
Mark Slee4af6ed72006-10-25 19:02:49 +0000160 virtual uint32_t writeBool(const bool value) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000161
Mark Slee4af6ed72006-10-25 19:02:49 +0000162 virtual uint32_t writeByte(const int8_t byte) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000163
Mark Slee4af6ed72006-10-25 19:02:49 +0000164 virtual uint32_t writeI16(const int16_t i16) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000165
Mark Slee4af6ed72006-10-25 19:02:49 +0000166 virtual uint32_t writeI32(const int32_t i32) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000167
Mark Slee4af6ed72006-10-25 19:02:49 +0000168 virtual uint32_t writeI64(const int64_t i64) = 0;
Marc Slemko0b4ffa92006-08-11 02:49:29 +0000169
Mark Slee4af6ed72006-10-25 19:02:49 +0000170 virtual uint32_t writeDouble(const double dub) = 0;
Mark Sleec98d0502006-09-06 02:42:25 +0000171
Mark Slee4af6ed72006-10-25 19:02:49 +0000172 virtual uint32_t writeString(const std::string& str) = 0;
Mark Sleee8540632006-05-30 09:24:40 +0000173
David Reissc005b1b2008-02-15 01:38:18 +0000174 virtual uint32_t writeBinary(const std::string& str) = 0;
175
Mark Sleee8540632006-05-30 09:24:40 +0000176 /**
Mark Slee8d7e1f62006-06-07 06:48:56 +0000177 * Reading functions
Mark Sleee8540632006-05-30 09:24:40 +0000178 */
179
Mark Slee4af6ed72006-10-25 19:02:49 +0000180 virtual uint32_t readMessageBegin(std::string& name,
David Reiss96d23882007-07-26 21:10:32 +0000181 TMessageType& messageType,
182 int32_t& seqid) = 0;
David Reiss0c90f6f2008-02-06 22:18:40 +0000183
Mark Slee4af6ed72006-10-25 19:02:49 +0000184 virtual uint32_t readMessageEnd() = 0;
Marc Slemko0b4ffa92006-08-11 02:49:29 +0000185
Mark Slee4af6ed72006-10-25 19:02:49 +0000186 virtual uint32_t readStructBegin(std::string& name) = 0;
Marc Slemko0b4ffa92006-08-11 02:49:29 +0000187
Mark Slee4af6ed72006-10-25 19:02:49 +0000188 virtual uint32_t readStructEnd() = 0;
Marc Slemko0b4ffa92006-08-11 02:49:29 +0000189
Mark Slee4af6ed72006-10-25 19:02:49 +0000190 virtual uint32_t readFieldBegin(std::string& name,
David Reiss96d23882007-07-26 21:10:32 +0000191 TType& fieldType,
192 int16_t& fieldId) = 0;
David Reiss0c90f6f2008-02-06 22:18:40 +0000193
Mark Slee4af6ed72006-10-25 19:02:49 +0000194 virtual uint32_t readFieldEnd() = 0;
David Reiss0c90f6f2008-02-06 22:18:40 +0000195
Mark Slee4af6ed72006-10-25 19:02:49 +0000196 virtual uint32_t readMapBegin(TType& keyType,
David Reiss96d23882007-07-26 21:10:32 +0000197 TType& valType,
198 uint32_t& size) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000199
Mark Slee4af6ed72006-10-25 19:02:49 +0000200 virtual uint32_t readMapEnd() = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000201
Mark Slee4af6ed72006-10-25 19:02:49 +0000202 virtual uint32_t readListBegin(TType& elemType,
David Reiss96d23882007-07-26 21:10:32 +0000203 uint32_t& size) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000204
Mark Slee4af6ed72006-10-25 19:02:49 +0000205 virtual uint32_t readListEnd() = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000206
Mark Slee4af6ed72006-10-25 19:02:49 +0000207 virtual uint32_t readSetBegin(TType& elemType,
David Reiss96d23882007-07-26 21:10:32 +0000208 uint32_t& size) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000209
Mark Slee4af6ed72006-10-25 19:02:49 +0000210 virtual uint32_t readSetEnd() = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000211
Mark Slee4af6ed72006-10-25 19:02:49 +0000212 virtual uint32_t readBool(bool& value) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000213
Mark Slee4af6ed72006-10-25 19:02:49 +0000214 virtual uint32_t readByte(int8_t& byte) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000215
Mark Slee4af6ed72006-10-25 19:02:49 +0000216 virtual uint32_t readI16(int16_t& i16) = 0;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000217
Mark Slee4af6ed72006-10-25 19:02:49 +0000218 virtual uint32_t readI32(int32_t& i32) = 0;
Marc Slemko0b4ffa92006-08-11 02:49:29 +0000219
Mark Slee4af6ed72006-10-25 19:02:49 +0000220 virtual uint32_t readI64(int64_t& i64) = 0;
Marc Slemko0b4ffa92006-08-11 02:49:29 +0000221
Mark Slee4af6ed72006-10-25 19:02:49 +0000222 virtual uint32_t readDouble(double& dub) = 0;
Mark Sleec98d0502006-09-06 02:42:25 +0000223
Mark Slee4af6ed72006-10-25 19:02:49 +0000224 virtual uint32_t readString(std::string& str) = 0;
Mark Sleee8540632006-05-30 09:24:40 +0000225
David Reissc005b1b2008-02-15 01:38:18 +0000226 virtual uint32_t readBinary(std::string& str) = 0;
227
David Reiss035aed92009-02-10 21:38:48 +0000228 uint32_t readBool(std::vector<bool>::reference ref) {
229 bool value;
230 uint32_t rv = readBool(value);
231 ref = value;
David Reiss57b50062009-02-25 00:59:55 +0000232 return rv;
David Reiss035aed92009-02-10 21:38:48 +0000233 }
234
Mark Sleee8540632006-05-30 09:24:40 +0000235 /**
Mark Slee8d7e1f62006-06-07 06:48:56 +0000236 * Method to arbitrarily skip over data.
Mark Sleee8540632006-05-30 09:24:40 +0000237 */
Mark Slee4af6ed72006-10-25 19:02:49 +0000238 uint32_t skip(TType type) {
Mark Slee8d7e1f62006-06-07 06:48:56 +0000239 switch (type) {
Mark Slee78f58e22006-09-02 04:17:07 +0000240 case T_BOOL:
241 {
242 bool boolv;
Mark Slee4af6ed72006-10-25 19:02:49 +0000243 return readBool(boolv);
Mark Slee78f58e22006-09-02 04:17:07 +0000244 }
Mark Slee8d7e1f62006-06-07 06:48:56 +0000245 case T_BYTE:
246 {
Mark Slee78f58e22006-09-02 04:17:07 +0000247 int8_t bytev;
Mark Slee4af6ed72006-10-25 19:02:49 +0000248 return readByte(bytev);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000249 }
Mark Sleecfc01932006-09-01 22:18:16 +0000250 case T_I16:
Mark Slee8d7e1f62006-06-07 06:48:56 +0000251 {
Mark Sleecfc01932006-09-01 22:18:16 +0000252 int16_t i16;
Mark Slee4af6ed72006-10-25 19:02:49 +0000253 return readI16(i16);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000254 }
255 case T_I32:
256 {
257 int32_t i32;
Mark Slee4af6ed72006-10-25 19:02:49 +0000258 return readI32(i32);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000259 }
Mark Slee8d7e1f62006-06-07 06:48:56 +0000260 case T_I64:
261 {
262 int64_t i64;
Mark Slee4af6ed72006-10-25 19:02:49 +0000263 return readI64(i64);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000264 }
Mark Sleec98d0502006-09-06 02:42:25 +0000265 case T_DOUBLE:
266 {
267 double dub;
Mark Slee4af6ed72006-10-25 19:02:49 +0000268 return readDouble(dub);
Mark Sleec98d0502006-09-06 02:42:25 +0000269 }
Mark Slee8d7e1f62006-06-07 06:48:56 +0000270 case T_STRING:
271 {
272 std::string str;
David Reissc005b1b2008-02-15 01:38:18 +0000273 return readBinary(str);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000274 }
275 case T_STRUCT:
276 {
277 uint32_t result = 0;
278 std::string name;
Marc Slemko0b4ffa92006-08-11 02:49:29 +0000279 int16_t fid;
Mark Slee8d7e1f62006-06-07 06:48:56 +0000280 TType ftype;
Mark Slee4af6ed72006-10-25 19:02:49 +0000281 result += readStructBegin(name);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000282 while (true) {
Mark Slee4af6ed72006-10-25 19:02:49 +0000283 result += readFieldBegin(name, ftype, fid);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000284 if (ftype == T_STOP) {
285 break;
286 }
Mark Slee4af6ed72006-10-25 19:02:49 +0000287 result += skip(ftype);
288 result += readFieldEnd();
Mark Slee8d7e1f62006-06-07 06:48:56 +0000289 }
Mark Slee4af6ed72006-10-25 19:02:49 +0000290 result += readStructEnd();
Mark Slee8d7e1f62006-06-07 06:48:56 +0000291 return result;
292 }
293 case T_MAP:
294 {
295 uint32_t result = 0;
296 TType keyType;
297 TType valType;
Marc Slemkob09f5882006-08-23 22:03:34 +0000298 uint32_t i, size;
Mark Slee4af6ed72006-10-25 19:02:49 +0000299 result += readMapBegin(keyType, valType, size);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000300 for (i = 0; i < size; i++) {
Mark Slee4af6ed72006-10-25 19:02:49 +0000301 result += skip(keyType);
302 result += skip(valType);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000303 }
Mark Slee4af6ed72006-10-25 19:02:49 +0000304 result += readMapEnd();
Mark Slee8d7e1f62006-06-07 06:48:56 +0000305 return result;
306 }
307 case T_SET:
308 {
309 uint32_t result = 0;
310 TType elemType;
Marc Slemkob09f5882006-08-23 22:03:34 +0000311 uint32_t i, size;
Mark Slee4af6ed72006-10-25 19:02:49 +0000312 result += readSetBegin(elemType, size);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000313 for (i = 0; i < size; i++) {
Mark Slee4af6ed72006-10-25 19:02:49 +0000314 result += skip(elemType);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000315 }
Mark Slee4af6ed72006-10-25 19:02:49 +0000316 result += readSetEnd();
Mark Slee8d7e1f62006-06-07 06:48:56 +0000317 return result;
318 }
319 case T_LIST:
320 {
321 uint32_t result = 0;
322 TType elemType;
Marc Slemkob09f5882006-08-23 22:03:34 +0000323 uint32_t i, size;
Mark Slee4af6ed72006-10-25 19:02:49 +0000324 result += readListBegin(elemType, size);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000325 for (i = 0; i < size; i++) {
Mark Slee4af6ed72006-10-25 19:02:49 +0000326 result += skip(elemType);
Mark Slee8d7e1f62006-06-07 06:48:56 +0000327 }
Mark Slee4af6ed72006-10-25 19:02:49 +0000328 result += readListEnd();
Mark Slee8d7e1f62006-06-07 06:48:56 +0000329 return result;
330 }
331 default:
332 return 0;
333 }
334 }
Mark Sleee8540632006-05-30 09:24:40 +0000335
Mark Slee5ea15f92007-03-05 22:55:59 +0000336 inline boost::shared_ptr<TTransport> getTransport() {
Mark Slee43b6c632007-02-07 00:54:17 +0000337 return ptrans_;
Mark Slee4af6ed72006-10-25 19:02:49 +0000338 }
339
Aditya Agarwal9abb0d62007-01-24 22:53:54 +0000340 // TODO: remove these two calls, they are for backwards
341 // compatibility
Mark Slee5ea15f92007-03-05 22:55:59 +0000342 inline boost::shared_ptr<TTransport> getInputTransport() {
Mark Slee43b6c632007-02-07 00:54:17 +0000343 return ptrans_;
Aditya Agarwal9abb0d62007-01-24 22:53:54 +0000344 }
Mark Slee5ea15f92007-03-05 22:55:59 +0000345 inline boost::shared_ptr<TTransport> getOutputTransport() {
Mark Slee43b6c632007-02-07 00:54:17 +0000346 return ptrans_;
Mark Slee4af6ed72006-10-25 19:02:49 +0000347 }
348
Mark Sleee8540632006-05-30 09:24:40 +0000349 protected:
Mark Slee5ea15f92007-03-05 22:55:59 +0000350 TProtocol(boost::shared_ptr<TTransport> ptrans):
Mark Slee43b6c632007-02-07 00:54:17 +0000351 ptrans_(ptrans) {
352 trans_ = ptrans.get();
353 }
David Reiss0c90f6f2008-02-06 22:18:40 +0000354
Mark Slee5ea15f92007-03-05 22:55:59 +0000355 boost::shared_ptr<TTransport> ptrans_;
Mark Slee43b6c632007-02-07 00:54:17 +0000356 TTransport* trans_;
Mark Slee4af6ed72006-10-25 19:02:49 +0000357
358 private:
Mark Sleee8540632006-05-30 09:24:40 +0000359 TProtocol() {}
360};
361
Mark Slee4af6ed72006-10-25 19:02:49 +0000362/**
363 * Constructs input and output protocol objects given transports.
364 */
365class TProtocolFactory {
366 public:
367 TProtocolFactory() {}
368
369 virtual ~TProtocolFactory() {}
370
Aditya Agarwal9abb0d62007-01-24 22:53:54 +0000371 virtual boost::shared_ptr<TProtocol> getProtocol(boost::shared_ptr<TTransport> trans) = 0;
Mark Slee4af6ed72006-10-25 19:02:49 +0000372};
373
T Jake Lucianib5e62212009-01-31 22:36:20 +0000374}}} // apache::thrift::protocol
Marc Slemko6f038a72006-08-03 18:58:09 +0000375
Mark Sleef5f2be42006-09-05 21:05:31 +0000376#endif // #define _THRIFT_PROTOCOL_TPROTOCOL_H_ 1