예제 #1
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_ID = 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)
                        {
                            ID       = iprot.ReadString();
                            isset_ID = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Struct)
                        {
                            GeometryConstraint = new MGeometryConstraint();
                            GeometryConstraint.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.Struct)
                        {
                            VelocityConstraint = new MVelocityConstraint();
                            VelocityConstraint.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.Struct)
                        {
                            AccelerationConstraint = new MAccelerationConstraint();
                            AccelerationConstraint.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.Struct)
                        {
                            PathConstraint = new MPathConstraint();
                            PathConstraint.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.Struct)
                        {
                            JointPathConstraint = new MJointPathConstraint();
                            JointPathConstraint.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.Struct)
                        {
                            PostureConstraint = new MPostureConstraint();
                            PostureConstraint.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.Struct)
                        {
                            JointConstraint = new MJointConstraint();
                            JointConstraint.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.Map)
                        {
                            {
                                Properties = new Dictionary <string, string>();
                                TMap _map0 = iprot.ReadMapBegin();
                                for (int _i1 = 0; _i1 < _map0.Count; ++_i1)
                                {
                                    string _key2;
                                    string _val3;
                                    _key2             = iprot.ReadString();
                                    _val3             = iprot.ReadString();
                                    Properties[_key2] = _val3;
                                }
                                iprot.ReadMapEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_ID)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ID not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
예제 #2
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_posture = 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.Struct)
                        {
                            Posture = new MMIStandard.MAvatarPostureValues();
                            Posture.Read(iprot);
                            isset_posture = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                JointConstraints = new List <MJointConstraint>();
                                TList _list9 = iprot.ReadListBegin();
                                for (int _i10 = 0; _i10 < _list9.Count; ++_i10)
                                {
                                    MJointConstraint _elem11;
                                    _elem11 = new MJointConstraint();
                                    _elem11.Read(iprot);
                                    JointConstraints.Add(_elem11);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_posture)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Posture not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }