本文整理汇总了C#中Thrift.Protocol.TProtocol.DecrementRecursionDepth方法的典型用法代码示例。如果您正苦于以下问题:C# TProtocol.DecrementRecursionDepth方法的具体用法?C# TProtocol.DecrementRecursionDepth怎么用?C# TProtocol.DecrementRecursionDepth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thrift.Protocol.TProtocol
的用法示例。
在下文中一共展示了TProtocol.DecrementRecursionDepth方法的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.String) {
Id = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
finally
{
iprot.DecrementRecursionDepth();
}
}
示例2: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("ReqChannelInfo");
oprot.WriteStructBegin(struc);
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例3: Read
//.........这里部分代码省略.........
case 4:
if (field.Type == TType.I32) {
IntVal = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 5:
if (field.Type == TType.Double) {
DoubleVal = iprot.ReadDouble();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 6:
if (field.Type == TType.String) {
StrVal = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 7:
if (field.Type == TType.String) {
ByteArrVal = iprot.ReadBinary();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 8:
if (field.Type == TType.Map) {
{
MapVal = new Dictionary<BaseMsg, BaseMsg>();
TMap _map0 = iprot.ReadMapBegin();
for( int _i1 = 0; _i1 < _map0.Count; ++_i1)
{
BaseMsg _key2;
BaseMsg _val3;
_key2 = new BaseMsg();
_key2.Read(iprot);
_val3 = new BaseMsg();
_val3.Read(iprot);
MapVal[_key2] = _val3;
}
iprot.ReadMapEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 9:
if (field.Type == TType.List) {
{
ListVal = new List<BaseMsg>();
TList _list4 = iprot.ReadListBegin();
for( int _i5 = 0; _i5 < _list4.Count; ++_i5)
{
BaseMsg _elem6;
_elem6 = new BaseMsg();
_elem6.Read(iprot);
ListVal.Add(_elem6);
}
iprot.ReadListEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 10:
if (field.Type == TType.Set) {
{
SetVal = new THashSet<BaseMsg>();
TSet _set7 = iprot.ReadSetBegin();
for( int _i8 = 0; _i8 < _set7.Count; ++_i8)
{
BaseMsg _elem9;
_elem9 = new BaseMsg();
_elem9.Read(iprot);
SetVal.Add(_elem9);
}
iprot.ReadSetEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
if (!isset_msgType)
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
finally
{
iprot.DecrementRecursionDepth();
}
}
示例4: 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();
}
}
示例5: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("NtfTestString");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Message != null && __isset.message) {
field.Name = "message";
field.Type = TType.String;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteString(Message);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例6: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("ReqSangcharim");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (__isset.sangcharim) {
field.Name = "sangcharim";
field.Type = TType.I32;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteI32((int)Sangcharim);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.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: Write
//.........这里部分代码省略.........
field.Type = TType.Bool;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteBool(BoolVal);
oprot.WriteFieldEnd();
}
if (__isset.byteVal) {
field.Name = "byteVal";
field.Type = TType.Byte;
field.ID = 3;
oprot.WriteFieldBegin(field);
oprot.WriteByte(ByteVal);
oprot.WriteFieldEnd();
}
if (__isset.intVal) {
field.Name = "intVal";
field.Type = TType.I32;
field.ID = 4;
oprot.WriteFieldBegin(field);
oprot.WriteI32(IntVal);
oprot.WriteFieldEnd();
}
if (__isset.doubleVal) {
field.Name = "doubleVal";
field.Type = TType.Double;
field.ID = 5;
oprot.WriteFieldBegin(field);
oprot.WriteDouble(DoubleVal);
oprot.WriteFieldEnd();
}
if (StrVal != null && __isset.strVal) {
field.Name = "strVal";
field.Type = TType.String;
field.ID = 6;
oprot.WriteFieldBegin(field);
oprot.WriteString(StrVal);
oprot.WriteFieldEnd();
}
if (ByteArrVal != null && __isset.byteArrVal) {
field.Name = "byteArrVal";
field.Type = TType.String;
field.ID = 7;
oprot.WriteFieldBegin(field);
oprot.WriteBinary(ByteArrVal);
oprot.WriteFieldEnd();
}
if (MapVal != null && __isset.mapVal) {
field.Name = "mapVal";
field.Type = TType.Map;
field.ID = 8;
oprot.WriteFieldBegin(field);
{
oprot.WriteMapBegin(new TMap(TType.Struct, TType.Struct, MapVal.Count));
foreach (BaseMsg _iter10 in MapVal.Keys)
{
_iter10.Write(oprot);
MapVal[_iter10].Write(oprot);
}
oprot.WriteMapEnd();
}
oprot.WriteFieldEnd();
}
if (ListVal != null && __isset.listVal) {
field.Name = "listVal";
field.Type = TType.List;
field.ID = 9;
oprot.WriteFieldBegin(field);
{
oprot.WriteListBegin(new TList(TType.Struct, ListVal.Count));
foreach (BaseMsg _iter11 in ListVal)
{
_iter11.Write(oprot);
}
oprot.WriteListEnd();
}
oprot.WriteFieldEnd();
}
if (SetVal != null && __isset.setVal) {
field.Name = "setVal";
field.Type = TType.Set;
field.ID = 10;
oprot.WriteFieldBegin(field);
{
oprot.WriteSetBegin(new TSet(TType.Struct, SetVal.Count));
foreach (BaseMsg _iter12 in SetVal)
{
_iter12.Write(oprot);
}
oprot.WriteSetEnd();
}
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例9: 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();
}
}
示例10: 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();
}
}
示例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("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();
}
}
示例13: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("AnsLogin");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (__isset.usn) {
field.Name = "usn";
field.Type = TType.I64;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteI64(Usn);
oprot.WriteFieldEnd();
}
if (NickName != null && __isset.nickName) {
field.Name = "nickName";
field.Type = TType.String;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteString(NickName);
oprot.WriteFieldEnd();
}
if (Comment != null && __isset.comment) {
field.Name = "comment";
field.Type = TType.String;
field.ID = 3;
oprot.WriteFieldBegin(field);
oprot.WriteString(Comment);
oprot.WriteFieldEnd();
}
if (__isset.level) {
field.Name = "level";
field.Type = TType.I32;
field.ID = 4;
oprot.WriteFieldBegin(field);
oprot.WriteI32(Level);
oprot.WriteFieldEnd();
}
if (__isset.victoryCount) {
field.Name = "victoryCount";
field.Type = TType.I32;
field.ID = 5;
oprot.WriteFieldBegin(field);
oprot.WriteI32(VictoryCount);
oprot.WriteFieldEnd();
}
if (__isset.defeatCount) {
field.Name = "defeatCount";
field.Type = TType.I32;
field.ID = 6;
oprot.WriteFieldBegin(field);
oprot.WriteI32(DefeatCount);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例14: Write
public void Write(TProtocol oprot) {
oprot.IncrementRecursionDepth();
try
{
TStruct struc = new TStruct("ServiceConfig");
oprot.WriteStructBegin(struc);
TField field = new TField();
field.Name = "pageId";
field.Type = TType.String;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteString(PageId);
oprot.WriteFieldEnd();
field.Name = "pollingPeriod";
field.Type = TType.I32;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteI32(PollingPeriod);
oprot.WriteFieldEnd();
field.Name = "rainmeterExe";
field.Type = TType.String;
field.ID = 3;
oprot.WriteFieldBegin(field);
oprot.WriteString(RainmeterExe);
oprot.WriteFieldEnd();
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
finally
{
oprot.DecrementRecursionDepth();
}
}
示例15: 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.I64) {
Usn = iprot.ReadI64();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.String) {
NickName = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.String) {
Comment = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 4:
if (field.Type == TType.I32) {
Level = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 5:
if (field.Type == TType.I32) {
VictoryCount = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 6:
if (field.Type == TType.I32) {
DefeatCount = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
finally
{
iprot.DecrementRecursionDepth();
}
}