Beispiel #1
0
            public void Write(ThriftProtocol oprot)
            {
                oprot.IncrementRecursionDepth();
                try
                {
                    var struc = new TStruct(/*"Log_args"*/);
                    oprot.WriteStructBegin(struc);
                    TField field = new TField();
                    if (Messages != null)
                    {
//						field.Name = "messages";
                        field.Type = TType.List;
                        field.ID   = 1;
                        oprot.WriteFieldBegin(field);
                        {
                            oprot.WriteListBegin(new TList(TType.Struct, Messages.Count));
                            foreach (LogEntry logEntry in Messages)
                            {
                                // logEntry.Write(oprot);
                                LogEntrySerializer.Write(oprot, logEntry);
                            }
                            oprot.WriteListEnd();
                        }
                        oprot.WriteFieldEnd();
                    }
                    oprot.WriteFieldStop();
                    oprot.WriteStructEnd();
                }
                finally
                {
                    oprot.DecrementRecursionDepth();
                }
            }
Beispiel #2
0
            public void Read(ThriftProtocol 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.List)
                            {
                                {
                                    Messages = new List <LogEntry>();
                                    TList list = iprot.ReadListBegin();
                                    for (int i = 0; i < list.Count; ++i)
                                    {
                                        var entry = LogEntrySerializer.Read(iprot);
                                        Messages.Add(entry);
                                    }
                                    iprot.ReadListEnd();
                                }
                            }
                            else
                            {
                                iprot.Skip(field.Type);
                            }
                            break;

                        default:
                            iprot.Skip(field.Type);
                            break;
                        }
                        iprot.ReadFieldEnd();
                    }
                    iprot.ReadStructEnd();
                }
                finally
                {
                    iprot.DecrementRecursionDepth();
                }
            }