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

                case 2:
                    if (field.Type == TType.String)
                    {
                        End_token       = iprot.ReadString();
                        isset_end_token = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.List)
                    {
                        {
                            Endpoints = new List <string>();
                            TList _list28 = iprot.ReadListBegin();
                            for (int _i29 = 0; _i29 < _list28.Count; ++_i29)
                            {
                                string _elem30 = null;
                                _elem30 = iprot.ReadString();
                                Endpoints.Add(_elem30);
                            }
                            iprot.ReadListEnd();
                        }
                        isset_endpoints = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.List)
                    {
                        {
                            Rpc_endpoints = new List <string>();
                            TList _list31 = iprot.ReadListBegin();
                            for (int _i32 = 0; _i32 < _list31.Count; ++_i32)
                            {
                                string _elem33 = null;
                                _elem33 = iprot.ReadString();
                                Rpc_endpoints.Add(_elem33);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            Endpoint_details = new List <EndpointDetails>();
                            TList _list34 = iprot.ReadListBegin();
                            for (int _i35 = 0; _i35 < _list34.Count; ++_i35)
                            {
                                EndpointDetails _elem36 = new EndpointDetails();
                                _elem36 = new EndpointDetails();
                                _elem36.Read(iprot);
                                Endpoint_details.Add(_elem36);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_start_token)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_end_token)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_endpoints)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
Exemplo n.º 2
0
        public void Read(TProtocol iprot)
        {
            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)
                    {
                        Start_token = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        End_token = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.List)
                    {
                        {
                            Endpoints = new List <string>();
                            TList _list24 = iprot.ReadListBegin();
                            for (int _i25 = 0; _i25 < _list24.Count; ++_i25)
                            {
                                string _elem26 = null;
                                _elem26 = iprot.ReadString();
                                Endpoints.Add(_elem26);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.List)
                    {
                        {
                            Rpc_endpoints = new List <string>();
                            TList _list27 = iprot.ReadListBegin();
                            for (int _i28 = 0; _i28 < _list27.Count; ++_i28)
                            {
                                string _elem29 = null;
                                _elem29 = iprot.ReadString();
                                Rpc_endpoints.Add(_elem29);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            Endpoint_details = new List <EndpointDetails>();
                            TList _list30 = iprot.ReadListBegin();
                            for (int _i31 = 0; _i31 < _list30.Count; ++_i31)
                            {
                                EndpointDetails _elem32 = new EndpointDetails();
                                _elem32 = new EndpointDetails();
                                _elem32.Read(iprot);
                                Endpoint_details.Add(_elem32);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
Exemplo n.º 3
0
 public void Read (TProtocol iprot)
 {
   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) {
           Start_token = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.String) {
           End_token = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.List) {
           {
             Endpoints = new List<string>();
             TList _list24 = iprot.ReadListBegin();
             for( int _i25 = 0; _i25 < _list24.Count; ++_i25)
             {
               string _elem26 = null;
               _elem26 = iprot.ReadString();
               Endpoints.Add(_elem26);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.List) {
           {
             Rpc_endpoints = new List<string>();
             TList _list27 = iprot.ReadListBegin();
             for( int _i28 = 0; _i28 < _list27.Count; ++_i28)
             {
               string _elem29 = null;
               _elem29 = iprot.ReadString();
               Rpc_endpoints.Add(_elem29);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.List) {
           {
             Endpoint_details = new List<EndpointDetails>();
             TList _list30 = iprot.ReadListBegin();
             for( int _i31 = 0; _i31 < _list30.Count; ++_i31)
             {
               EndpointDetails _elem32 = new EndpointDetails();
               _elem32 = new EndpointDetails();
               _elem32.Read(iprot);
               Endpoint_details.Add(_elem32);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Exemplo n.º 4
0
 public void Read (TProtocol iprot)
 {
   bool isset_start_token = false;
   bool isset_end_token = false;
   bool isset_endpoints = 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) {
           Start_token = iprot.ReadString();
           isset_start_token = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.String) {
           End_token = iprot.ReadString();
           isset_end_token = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.List) {
           {
             Endpoints = new List<string>();
             TList _list28 = iprot.ReadListBegin();
             for( int _i29 = 0; _i29 < _list28.Count; ++_i29)
             {
               string _elem30 = null;
               _elem30 = iprot.ReadString();
               Endpoints.Add(_elem30);
             }
             iprot.ReadListEnd();
           }
           isset_endpoints = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.List) {
           {
             Rpc_endpoints = new List<string>();
             TList _list31 = iprot.ReadListBegin();
             for( int _i32 = 0; _i32 < _list31.Count; ++_i32)
             {
               string _elem33 = null;
               _elem33 = iprot.ReadString();
               Rpc_endpoints.Add(_elem33);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.List) {
           {
             Endpoint_details = new List<EndpointDetails>();
             TList _list34 = iprot.ReadListBegin();
             for( int _i35 = 0; _i35 < _list34.Count; ++_i35)
             {
               EndpointDetails _elem36 = new EndpointDetails();
               _elem36 = new EndpointDetails();
               _elem36.Read(iprot);
               Endpoint_details.Add(_elem36);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
   if (!isset_start_token)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
   if (!isset_end_token)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
   if (!isset_endpoints)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
 }