本文整理汇总了C#中IILGen.Call方法的典型用法代码示例。如果您正苦于以下问题:C# IILGen.Call方法的具体用法?C# IILGen.Call怎么用?C# IILGen.Call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IILGen
的用法示例。
在下文中一共展示了IILGen.Call方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
public void Load(IILGen ilGenerator, Action<IILGen> pushReaderOrCtx)
{
pushReaderOrCtx(ilGenerator);
Type typeRead;
if (_signed)
{
ilGenerator.Call(() => default(AbstractBufferedReader).ReadVInt64());
typeRead = typeof(long);
}
else
{
ilGenerator.Call(() => default(AbstractBufferedReader).ReadVUInt64());
typeRead = typeof(ulong);
}
new DefaultTypeConvertorGenerator().GenerateConversion(typeRead, _enumType.GetEnumUnderlyingType())(ilGenerator);
}
示例2: GenerateLoad
public void GenerateLoad(IILGen ilGenerator, Action<IILGen> pushReader, Action<IILGen> pushCtx, Action<IILGen> pushDescriptor, Type targetType)
{
pushReader(ilGenerator);
ilGenerator.Call(() => default(AbstractBufferedReader).ReadByteArray());
if (targetType == typeof (ByteBuffer))
{
ilGenerator.Call(() => ByteBuffer.NewAsync(null));
return;
}
if (targetType != typeof (object))
{
if (targetType!=typeof(byte[]))
throw new ArgumentOutOfRangeException(nameof(targetType));
return;
}
ilGenerator.Castclass(typeof(object));
}
示例3: GenerateSave
public void GenerateSave(IILGen ilGenerator, Action<IILGen> pushWriter, Action<IILGen> pushCtx, Action<IILGen> pushValue, Type valueType)
{
pushWriter(ilGenerator);
pushValue(ilGenerator);
if (valueType==typeof(byte[]))
ilGenerator.Call(() => default(AbstractBufferedWriter).WriteByteArray(null));
else if (valueType==typeof(ByteBuffer))
ilGenerator.Call(() => default(AbstractBufferedWriter).WriteByteArray(ByteBuffer.NewEmpty()));
else throw new ArgumentOutOfRangeException(nameof(valueType));
}
示例4: GenerateLoad
public void GenerateLoad(IILGen ilGenerator, Action<IILGen> pushReader, Action<IILGen> pushCtx, Action<IILGen> pushDescriptor, Type targetType)
{
pushReader(ilGenerator);
ilGenerator.Call(_loader);
if (targetType != typeof(object))
{
if (targetType != GetPreferedType())
throw new ArgumentOutOfRangeException(nameof(targetType));
return;
}
if (GetPreferedType().IsValueType)
{
ilGenerator.Box(GetPreferedType());
}
else
{
ilGenerator.Castclass(typeof(object));
}
}
示例5: GenerateSkip
public void GenerateSkip(IILGen ilGenerator, Action<IILGen> pushReader, Action<IILGen> pushCtx)
{
pushReader(ilGenerator);
if (_signed)
{
ilGenerator.Call(() => default(AbstractBufferedReader).SkipVInt64());
}
else
{
ilGenerator.Call(() => default(AbstractBufferedReader).SkipVUInt64());
}
}
示例6: GenerateLoad
public void GenerateLoad(IILGen ilGenerator, Action<IILGen> pushReader, Action<IILGen> pushCtx, Action<IILGen> pushDescriptor, Type targetType)
{
pushReader(ilGenerator);
Type typeRead;
if (_signed)
{
ilGenerator.Call(() => default(AbstractBufferedReader).ReadVInt64());
typeRead = typeof(long);
}
else
{
ilGenerator.Call(() => default(AbstractBufferedReader).ReadVUInt64());
typeRead = typeof(ulong);
}
if (targetType == typeof(object))
{
ilGenerator.Do(pushDescriptor);
if (_signed)
{
ilGenerator.Newobj(() => new DynamicEnum(0L, null));
}
else
{
ilGenerator.Newobj(() => new DynamicEnum(0UL, null));
}
ilGenerator.Castclass(typeof(object));
return;
}
new DefaultTypeConvertorGenerator().GenerateConversion(typeRead, targetType.GetEnumUnderlyingType())(ilGenerator);
}
示例7: GenerateSave
public void GenerateSave(IILGen ilGenerator, Action<IILGen> pushWriter, Action<IILGen> pushCtx, Action<IILGen> pushValue, Type valueType)
{
pushWriter(ilGenerator);
pushValue(ilGenerator);
ilGenerator.Call(_saver);
}
示例8: GenerateSkip
public void GenerateSkip(IILGen ilGenerator, Action<IILGen> pushReader, Action<IILGen> pushCtx)
{
pushReader(ilGenerator);
ilGenerator.Call(_skipper);
}
示例9: Save
public void Save(IILGen ilGenerator, Action<IILGen> pushWriterOrCtx, Action<IILGen> pushValue)
{
pushWriterOrCtx(ilGenerator);
pushValue(ilGenerator);
ilGenerator.Call(_saver);
}
示例10: Skip
public void Skip(IILGen ilGenerator, Action<IILGen> pushReaderOrCtx)
{
if (_skipper == null) return;
pushReaderOrCtx(ilGenerator);
ilGenerator.Call(_skipper);
}
示例11: Load
public void Load(IILGen ilGenerator, Action<IILGen> pushReaderOrCtx)
{
pushReaderOrCtx(ilGenerator);
ilGenerator.Call(_loader);
}
示例12: SaveByteBuffer
protected virtual void SaveByteBuffer(IILGen ilGenerator, Action<IILGen> pushWriterOrCtx, Action<IILGen> pushValue)
{
pushWriterOrCtx(ilGenerator);
pushValue(ilGenerator);
ilGenerator.Call(() => default(AbstractBufferedWriter).WriteByteArray(ByteBuffer.NewEmpty()));
}
示例13: Skip
public virtual void Skip(IILGen ilGenerator, Action<IILGen> pushReaderOrCtx)
{
pushReaderOrCtx(ilGenerator);
ilGenerator.Call(() => default(AbstractBufferedReader).SkipByteArray());
}
示例14: Save
public virtual void Save(IILGen ilGenerator, Action<IILGen> pushWriterOrCtx, Action<IILGen> pushValue)
{
pushWriterOrCtx(ilGenerator);
pushValue(ilGenerator);
ilGenerator.Call(() => default(AbstractBufferedWriter).WriteByteArray(null));
}
示例15: Load
public void Load(IILGen ilGenerator, Action<IILGen> pushReaderOrCtx)
{
_fieldHandler.Load(ilGenerator, pushReaderOrCtx);
ilGenerator.Call(() => ByteBuffer.NewAsync(null));
}