123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511 |
- ///**
- // * Autogenerated by Thrift Compiler (0.12.0)
- // *
- // * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- // * @generated
- // */
- //using System;
- //using System.Collections;
- //using System.Collections.Generic;
- //using System.Text;
- //using System.IO;
- //using Thrift;
- //using Thrift.Collections;
- //using System.Runtime.Serialization;
- //using Thrift.Protocol;
- //using Thrift.Transport;
- //public partial class ShareLog
- //{
- // public interface ISync
- // {
- // string SendMessage(string message, string type = "");
- // }
- // public interface Iface : ISync
- // {
- //#if SILVERLIGHT
- // IAsyncResult Begin_SendMessage(AsyncCallback callback, object state, string message);
- // string End_SendMessage(IAsyncResult asyncResult);
- //#endif
- // }
- // public class Client : IDisposable, Iface
- // {
- // public Client(TProtocol prot) : this(prot, prot)
- // {
- // }
- // public Client(TProtocol iprot, TProtocol oprot)
- // {
- // iprot_ = iprot;
- // oprot_ = oprot;
- // }
- // protected TProtocol iprot_;
- // protected TProtocol oprot_;
- // protected int seqid_;
- // public TProtocol InputProtocol
- // {
- // get { return iprot_; }
- // }
- // public TProtocol OutputProtocol
- // {
- // get { return oprot_; }
- // }
- // #region " IDisposable Support "
- // private bool _IsDisposed;
- // // IDisposable
- // public void Dispose()
- // {
- // Dispose(true);
- // }
- // protected virtual void Dispose(bool disposing)
- // {
- // if (!_IsDisposed)
- // {
- // if (disposing)
- // {
- // if (iprot_ != null)
- // {
- // ((IDisposable)iprot_).Dispose();
- // }
- // if (oprot_ != null)
- // {
- // ((IDisposable)oprot_).Dispose();
- // }
- // }
- // }
- // _IsDisposed = true;
- // }
- // #endregion
- //#if SILVERLIGHT
- // public IAsyncResult Begin_SendMessage(AsyncCallback callback, object state, string message)
- // {
- // return send_SendMessage(callback, state, message);
- // }
- // public string End_SendMessage(IAsyncResult asyncResult)
- // {
- // oprot_.Transport.EndFlush(asyncResult);
- // return recv_SendMessage();
- // }
- //#endif
- // public string SendMessage(string message)
- // {
- //#if SILVERLIGHT
- // var asyncResult = Begin_SendMessage(null, null, message);
- // return End_SendMessage(asyncResult);
- //#else
- // return "ok";
- //#endif
- // }
- //#if SILVERLIGHT
- // public IAsyncResult send_SendMessage(AsyncCallback callback, object state, string message)
- // {
- // oprot_.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Call, seqid_));
- // SendMessage_args args = new SendMessage_args();
- // args.Message = message;
- // args.Write(oprot_);
- // oprot_.WriteMessageEnd();
- // return oprot_.Transport.BeginFlush(callback, state);
- // }
- //#else
- // public void send_SendMessage(string message, string type)
- // {
- // oprot_.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Call, seqid_));
- // SendMessage_args args = new SendMessage_args();
- // args.Message = message;
- // args.Type = type;
- // args.Write(oprot_);
- // oprot_.WriteMessageEnd();
- // oprot_.Transport.Flush();
- // }
- //#endif
- // public string recv_SendMessage()
- // {
- // TMessage msg = iprot_.ReadMessageBegin();
- // if (msg.Type == TMessageType.Exception)
- // {
- // TApplicationException x = TApplicationException.Read(iprot_);
- // iprot_.ReadMessageEnd();
- // throw x;
- // }
- // SendMessage_result result = new SendMessage_result();
- // result.Read(iprot_);
- // iprot_.ReadMessageEnd();
- // if (result.__isset.success)
- // {
- // return result.Success;
- // }
- // throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "SendMessage failed: unknown result");
- // }
- // public string SendMessage(string message, string type = "")
- // {
- // send_SendMessage(message, type);
- // return "ok";
- // }
- // }
- // public class Processor : TProcessor
- // {
- // public Processor(ISync iface)
- // {
- // iface_ = iface;
- // processMap_["SendMessage"] = SendMessage_Process;
- // }
- // protected delegate void ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot);
- // private ISync iface_;
- // protected Dictionary<string, ProcessFunction> processMap_ = new Dictionary<string, ProcessFunction>();
- // public bool Process(TProtocol iprot, TProtocol oprot)
- // {
- // try
- // {
- // TMessage msg = iprot.ReadMessageBegin();
- // ProcessFunction fn;
- // processMap_.TryGetValue(msg.Name, out fn);
- // if (fn == null)
- // {
- // TProtocolUtil.Skip(iprot, TType.Struct);
- // iprot.ReadMessageEnd();
- // TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.UnknownMethod, "Invalid method name: '" + msg.Name + "'");
- // oprot.WriteMessageBegin(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID));
- // x.Write(oprot);
- // oprot.WriteMessageEnd();
- // oprot.Transport.Flush();
- // return true;
- // }
- // fn(msg.SeqID, iprot, oprot);
- // }
- // catch (IOException)
- // {
- // return false;
- // }
- // return true;
- // }
- // public void SendMessage_Process(int seqid, TProtocol iprot, TProtocol oprot)
- // {
- // SendMessage_args args = new SendMessage_args();
- // args.Read(iprot);
- // iprot.ReadMessageEnd();
- // SendMessage_result result = new SendMessage_result();
- // try
- // {
- // result.Success = iface_.SendMessage(args.Message);
- // //oprot.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Reply, seqid));
- // //result.Write(oprot);
- // }
- // catch (TTransportException)
- // {
- // throw;
- // }
- // catch (Exception ex)
- // {
- // Console.Error.WriteLine("Error occurred in processor:");
- // Console.Error.WriteLine(ex.ToString());
- // TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
- // oprot.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Exception, seqid));
- // x.Write(oprot);
- // }
- // oprot.WriteMessageEnd();
- // oprot.Transport.Flush();
- // }
- // }
- //#if !SILVERLIGHT
- // [Serializable]
- //#endif
- // public partial class SendMessage_args : TBase
- // {
- // private string _message;
- // private string _type;
- // public string Message
- // {
- // get
- // {
- // return _message;
- // }
- // set
- // {
- // __isset.message = true;
- // this._message = value;
- // }
- // }
- // public string Type
- // {
- // get
- // {
- // return _type;
- // }
- // set
- // {
- // __isset.type = true;
- // this._type = value;
- // }
- // }
- // public Isset __isset;
- //#if !SILVERLIGHT
- // [Serializable]
- //#endif
- // public struct Isset
- // {
- // public bool message;
- // public bool type;
- // }
- // public SendMessage_args()
- // {
- // }
- // public void Read(TProtocol iprot)
- // {
- // iprot.IncrementRecursionDepth();
- // try
- // {
- // TField field;
- // iprot.ReadStructBegin();
- // while (true)
- // {
- // field = iprot.ReadFieldBegin();
- // if (field.Type == TType.Stop)
- // {
- // break;
- // }
- // switch (field.ID)
- // {
- // case 1:
- // if (field.Type == TType.String)
- // {
- // Message = iprot.ReadString();
- // }
- // else
- // {
- // TProtocolUtil.Skip(iprot, field.Type);
- // }
- // break;
- // case 2:
- // if (field.Type == TType.String)
- // {
- // Type = iprot.ReadString();
- // }
- // else
- // {
- // TProtocolUtil.Skip(iprot, field.Type);
- // }
- // break;
- // default:
- // TProtocolUtil.Skip(iprot, field.Type);
- // break;
- // }
- // iprot.ReadFieldEnd();
- // }
- // iprot.ReadStructEnd();
- // }
- // finally
- // {
- // iprot.DecrementRecursionDepth();
- // }
- // }
- // public void Write(TProtocol oprot)
- // {
- // oprot.IncrementRecursionDepth();
- // try
- // {
- // TStruct struc = new TStruct("SendMessage_args");
- // oprot.WriteStructBegin(struc);
- // TField field = new TField();
- // if (Message != null && __isset.message)
- // {
- // field.Name = "message";
- // field.Type = TType.String;
- // field.ID = 1;
- // oprot.WriteFieldBegin(field);
- // oprot.WriteString(Message);
- // oprot.WriteFieldEnd();
- // }
- // if (Type != null && __isset.type)
- // {
- // field.Name = "type";
- // field.Type = TType.String;
- // field.ID = 2;
- // oprot.WriteFieldBegin(field);
- // oprot.WriteString(Type);
- // oprot.WriteFieldEnd();
- // }
- // oprot.WriteFieldStop();
- // oprot.WriteStructEnd();
- // }
- // finally
- // {
- // oprot.DecrementRecursionDepth();
- // }
- // }
- // public override string ToString()
- // {
- // StringBuilder __sb = new StringBuilder("SendMessage_args(");
- // bool __first = true;
- // if (Message != null && __isset.message)
- // {
- // if (!__first) { __sb.Append(", "); }
- // __first = false;
- // __sb.Append("Message: ");
- // __sb.Append(Message);
- // }
- // if (Type != null && __isset.type)
- // {
- // if (!__first) { __sb.Append(", "); }
- // __first = false;
- // __sb.Append("Type: ");
- // __sb.Append(Type);
- // }
- // __sb.Append(")");
- // return __sb.ToString();
- // }
- // }
- //#if !SILVERLIGHT
- // [Serializable]
- //#endif
- // public partial class SendMessage_result : TBase
- // {
- // private string _success;
- // public string Success
- // {
- // get
- // {
- // return _success;
- // }
- // set
- // {
- // __isset.success = true;
- // this._success = value;
- // }
- // }
- // public Isset __isset;
- //#if !SILVERLIGHT
- // [Serializable]
- //#endif
- // public struct Isset
- // {
- // public bool success;
- // }
- // public SendMessage_result()
- // {
- // }
- // public void Read(TProtocol iprot)
- // {
- // iprot.IncrementRecursionDepth();
- // try
- // {
- // TField field;
- // iprot.ReadStructBegin();
- // while (true)
- // {
- // field = iprot.ReadFieldBegin();
- // if (field.Type == TType.Stop)
- // {
- // break;
- // }
- // switch (field.ID)
- // {
- // case 0:
- // if (field.Type == TType.String)
- // {
- // Success = iprot.ReadString();
- // }
- // else
- // {
- // TProtocolUtil.Skip(iprot, field.Type);
- // }
- // break;
- // default:
- // TProtocolUtil.Skip(iprot, field.Type);
- // break;
- // }
- // iprot.ReadFieldEnd();
- // }
- // iprot.ReadStructEnd();
- // }
- // finally
- // {
- // iprot.DecrementRecursionDepth();
- // }
- // }
- // public void Write(TProtocol oprot)
- // {
- // oprot.IncrementRecursionDepth();
- // try
- // {
- // TStruct struc = new TStruct("SendMessage_result");
- // oprot.WriteStructBegin(struc);
- // TField field = new TField();
- // if (this.__isset.success)
- // {
- // if (Success != null)
- // {
- // field.Name = "Success";
- // field.Type = TType.String;
- // field.ID = 0;
- // oprot.WriteFieldBegin(field);
- // oprot.WriteString(Success);
- // oprot.WriteFieldEnd();
- // }
- // }
- // oprot.WriteFieldStop();
- // oprot.WriteStructEnd();
- // }
- // finally
- // {
- // oprot.DecrementRecursionDepth();
- // }
- // }
- // public override string ToString()
- // {
- // StringBuilder __sb = new StringBuilder("SendMessage_result(");
- // bool __first = true;
- // if (Success != null && __isset.success)
- // {
- // if (!__first) { __sb.Append(", "); }
- // __first = false;
- // __sb.Append("Success: ");
- // __sb.Append(Success);
- // }
- // __sb.Append(")");
- // return __sb.ToString();
- // }
- // }
- //}
|