David Reiss | 7f42bcf | 2008-01-11 20:59:12 +0000 | [diff] [blame^] | 1 | // |
| 2 | // TProtocol.cs |
| 3 | // |
| 4 | // Begin: Aug 19, 2007 |
| 5 | // Authors: |
| 6 | // Todd Berman <tberman@imeem.com> |
| 7 | // |
| 8 | // Distributed under the Thrift Software License |
| 9 | // |
| 10 | // See accompanying file LICENSE or visit the Thrift site at: |
| 11 | // http://developers.facebook.com/thrift/using |
| 12 | |
| 13 | using System; |
| 14 | using System.Collections.Generic; |
| 15 | using System.Text; |
| 16 | using Thrift.Transport; |
| 17 | |
| 18 | namespace Thrift.Protocol |
| 19 | { |
| 20 | public abstract class TProtocol |
| 21 | { |
| 22 | protected TTransport trans; |
| 23 | |
| 24 | protected TProtocol(TTransport trans) |
| 25 | { |
| 26 | this.trans = trans; |
| 27 | } |
| 28 | |
| 29 | public TTransport Transport |
| 30 | { |
| 31 | get { return trans; } |
| 32 | } |
| 33 | |
| 34 | public abstract void WriteMessageBegin(TMessage message); |
| 35 | public abstract void WriteMessageEnd(); |
| 36 | public abstract void WriteStructBegin(TStruct struc); |
| 37 | public abstract void WriteStructEnd(); |
| 38 | public abstract void WriteFieldBegin(TField field); |
| 39 | public abstract void WriteFieldEnd(); |
| 40 | public abstract void WriteFieldStop(); |
| 41 | public abstract void WriteMapBegin(TMap map); |
| 42 | public abstract void WriteMapEnd(); |
| 43 | public abstract void WriteListBegin(TList list); |
| 44 | public abstract void WriteListEnd(); |
| 45 | public abstract void WriteSetBegin(TSet set); |
| 46 | public abstract void WriteSetEnd(); |
| 47 | public abstract void WriteBool(bool b); |
| 48 | public abstract void WriteByte(byte b); |
| 49 | public abstract void WriteI16(short i16); |
| 50 | public abstract void WriteI32(int i32); |
| 51 | public abstract void WriteI64(long i64); |
| 52 | public abstract void WriteDouble(double d); |
| 53 | public abstract void WriteString(string s); |
| 54 | |
| 55 | public abstract TMessage ReadMessageBegin(); |
| 56 | public abstract void ReadMessageEnd(); |
| 57 | public abstract TStruct ReadStructBegin(); |
| 58 | public abstract void ReadStructEnd(); |
| 59 | public abstract TField ReadFieldBegin(); |
| 60 | public abstract void ReadFieldEnd(); |
| 61 | public abstract TMap ReadMapBegin(); |
| 62 | public abstract void ReadMapEnd(); |
| 63 | public abstract TList ReadListBegin(); |
| 64 | public abstract void ReadListEnd(); |
| 65 | public abstract TSet ReadSetBegin(); |
| 66 | public abstract void ReadSetEnd(); |
| 67 | public abstract bool ReadBool(); |
| 68 | public abstract byte ReadByte(); |
| 69 | public abstract short ReadI16(); |
| 70 | public abstract int ReadI32(); |
| 71 | public abstract long ReadI64(); |
| 72 | public abstract double ReadDouble(); |
| 73 | public abstract string ReadString(); |
| 74 | } |
| 75 | } |