Ejemplo n.º 1
0
        public void Read(TProtocol iprot)
        {
            bool   isset_uuidFicha = false;
            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)
                    {
                        UuidFicha       = iprot.ReadString();
                        isset_uuidFicha = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.I32)
                    {
                        TpCdsOrigem = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.List)
                    {
                        {
                            AtendimentosDomiciliares = new List <FichaAtendimentoDomiciliarChildThrift>();
                            TList _list12 = iprot.ReadListBegin();
                            for (int _i13 = 0; _i13 < _list12.Count; ++_i13)
                            {
                                FichaAtendimentoDomiciliarChildThrift _elem14;
                                _elem14 = new FichaAtendimentoDomiciliarChildThrift();
                                _elem14.Read(iprot);
                                AtendimentosDomiciliares.Add(_elem14);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.Struct)
                    {
                        HeaderTransport = new br.gov.saude.esusab.ras.common.VariasLotacoesHeaderThrift();
                        HeaderTransport.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_uuidFicha)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
 public void Read (TProtocol iprot)
 {
   bool isset_uuidFicha = false;
   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) {
           UuidFicha = iprot.ReadString();
           isset_uuidFicha = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.I32) {
           TpCdsOrigem = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.List) {
           {
             AtendimentosDomiciliares = new List<FichaAtendimentoDomiciliarChildThrift>();
             TList _list12 = iprot.ReadListBegin();
             for( int _i13 = 0; _i13 < _list12.Count; ++_i13)
             {
               FichaAtendimentoDomiciliarChildThrift _elem14;
               _elem14 = new FichaAtendimentoDomiciliarChildThrift();
               _elem14.Read(iprot);
               AtendimentosDomiciliares.Add(_elem14);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.Struct) {
           HeaderTransport = new br.gov.saude.esusab.ras.common.VariasLotacoesHeaderThrift();
           HeaderTransport.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
   if (!isset_uuidFicha)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
 }