本文整理汇总了C#中Thrift.Protocol.TProtocol.IncrementRecursionDepth方法的典型用法代码示例。如果您正苦于以下问题:C# TProtocol.IncrementRecursionDepth方法的具体用法?C# TProtocol.IncrementRecursionDepth怎么用?C# TProtocol.IncrementRecursionDepth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thrift.Protocol.TProtocol
的用法示例。
在下文中一共展示了TProtocol.IncrementRecursionDepth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
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.I32) {
Sangcharim = (Sangcharim)iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
finally
{
iprot.DecrementRecursionDepth();
}
}
示例2: Read
public void Read (TProtocol iprot)
{
iprot.IncrementRecursionDepth();
try
{
bool isset_MessageName = 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) {
MessageName = iprot.ReadString();
isset_MessageName = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.Map) {
{
MessageBody = new Dictionary<string, BaseMsg>();
TMap _map13 = iprot.ReadMapBegin();
for( int _i14 = 0; _i14 < _map13.Count; ++_i14)
{
string _key15;
BaseMsg _val16;
_key15 = iprot.ReadString();
_val16 = new BaseMsg();
_val16.Read(iprot);
MessageBody[_key15] = _val16;
}
iprot.ReadMapEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
if (!isset_MessageName)
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
finally
{
iprot.DecrementRecursionDepth();
}
}
示例3: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("ReqChannelInfo");
oprot.WriteStructBegin(struc);
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例4: Read
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.Bool) {
Success = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.String) {
Message = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.String) {
Result = iprot.ReadBinary();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
finally
{
iprot.DecrementRecursionDepth();
}
}
示例5: Read
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) {
UserName = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.String) {
LoginPlatform = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.String) {
DeviceDesc = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
finally
{
iprot.DecrementRecursionDepth();
}
}
示例6: Read
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) {
Id = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.I64) {
Revision = iprot.ReadI64();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.Double) {
LastResult = iprot.ReadDouble();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
finally
{
iprot.DecrementRecursionDepth();
}
}
示例7: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("ReqLogin");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (UserName != null && __isset.userName) {
field.Name = "userName";
field.Type = TType.String;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteString(UserName);
oprot.WriteFieldEnd();
}
if (LoginPlatform != null && __isset.loginPlatform) {
field.Name = "loginPlatform";
field.Type = TType.String;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteString(LoginPlatform);
oprot.WriteFieldEnd();
}
if (DeviceDesc != null && __isset.deviceDesc) {
field.Name = "deviceDesc";
field.Type = TType.String;
field.ID = 3;
oprot.WriteFieldBegin(field);
oprot.WriteString(DeviceDesc);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例8: Skip
public static void Skip(TProtocol prot, TType type)
{
prot.IncrementRecursionDepth();
try
{
switch (type)
{
case TType.Bool:
prot.ReadBool();
break;
case TType.Byte:
prot.ReadByte();
break;
case TType.I16:
prot.ReadI16();
break;
case TType.I32:
prot.ReadI32();
break;
case TType.I64:
prot.ReadI64();
break;
case TType.Double:
prot.ReadDouble();
break;
case TType.String:
// Don't try to decode the string, just skip it.
prot.ReadBinary();
break;
case TType.Struct:
prot.ReadStructBegin();
while (true)
{
TField field = prot.ReadFieldBegin();
if (field.Type == TType.Stop)
{
break;
}
Skip(prot, field.Type);
prot.ReadFieldEnd();
}
prot.ReadStructEnd();
break;
case TType.Map:
TMap map = prot.ReadMapBegin();
for (int i = 0; i < map.Count; i++)
{
Skip(prot, map.KeyType);
Skip(prot, map.ValueType);
}
prot.ReadMapEnd();
break;
case TType.Set:
TSet set = prot.ReadSetBegin();
for (int i = 0; i < set.Count; i++)
{
Skip(prot, set.ElementType);
}
prot.ReadSetEnd();
break;
case TType.List:
TList list = prot.ReadListBegin();
for (int i = 0; i < list.Count; i++)
{
Skip(prot, list.ElementType);
}
prot.ReadListEnd();
break;
}
}
finally
{
prot.DecrementRecursionDepth();
}
}
示例9: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("GetConfiguration_result");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (this.__isset.success) {
if (Success != null) {
field.Name = "Success";
field.Type = TType.Struct;
field.ID = 0;
oprot.WriteFieldBegin(field);
Success.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例10: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("NtfMatch");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (__isset.localId) {
field.Name = "localId";
field.Type = TType.I32;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteI32(LocalId);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例11: Read
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.Struct) {
Instance = new InstanceDescriptor();
Instance.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.I32) {
OpCode = (Operation)iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.Struct) {
Input = new InputData();
Input.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
finally
{
iprot.DecrementRecursionDepth();
}
}
示例12: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("Workpack");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Instance != null && __isset.Instance) {
field.Name = "Instance";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Instance.Write(oprot);
oprot.WriteFieldEnd();
}
if (__isset.OpCode) {
field.Name = "OpCode";
field.Type = TType.I32;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteI32((int)OpCode);
oprot.WriteFieldEnd();
}
if (Input != null && __isset.Input) {
field.Name = "Input";
field.Type = TType.Struct;
field.ID = 3;
oprot.WriteFieldBegin(field);
Input.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例13: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("InstanceDescriptor");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Id != null && __isset.Id) {
field.Name = "Id";
field.Type = TType.String;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteString(Id);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例14: Read
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.Struct) {
Success = new ServiceConfig();
Success.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
finally
{
iprot.DecrementRecursionDepth();
}
}
示例15: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("InstanceState");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Id != null && __isset.Id) {
field.Name = "Id";
field.Type = TType.String;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteString(Id);
oprot.WriteFieldEnd();
}
if (__isset.Revision) {
field.Name = "Revision";
field.Type = TType.I64;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteI64(Revision);
oprot.WriteFieldEnd();
}
if (__isset.LastResult) {
field.Name = "LastResult";
field.Type = TType.Double;
field.ID = 3;
oprot.WriteFieldBegin(field);
oprot.WriteDouble(LastResult);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}