[C#] Remove support for .NET 4.0

This commit is contained in:
Chad Walters 2017-06-26 15:10:40 -07:00 коммит произвёл Christopher Warrington
Родитель 6969b59b74
Коммит 3bbe401069
40 изменённых файлов: 19 добавлений и 624 удалений

Просмотреть файл

@ -80,6 +80,8 @@ get a compiler error. To fix, remove the `<Writer>` part:
### C# ###
* **Breaking change** Support for .NET 4.0 has been dropped from the
[supported frameworks](https://microsoft.github.io/bond/manual/bond_cs.html#frameworks-targeted).
* **Breaking change** The deprecated type `Bond.BondReflection` has been
removed. The type `Bond.Reflection` should be used instead.
* **Breaking change** Bond assemblies are now

Просмотреть файл

@ -295,9 +295,6 @@
if ($env:BOND_BUILD -eq "C#") {
nunit-console-x86 /framework:net-4.0 /labels "cs\test\core\bin\debug\net40\${env:BOND_OUTPUT}\Bond.UnitTest.dll" cs\test\internal\bin\debug\net40\Bond.InternalTest.dll
if (-not $?) { throw "tests failed" }
nunit-console-x86 /framework:net-4.5 /labels "cs\test\core\bin\debug\net45\${env:BOND_OUTPUT}\Bond.UnitTest.dll" cs\test\internal\bin\debug\net45\Bond.InternalTest.dll
if (-not $?) { throw "tests failed" }

Просмотреть файл

@ -54,21 +54,21 @@ if (WIN32)
# If C# has been built we will also run C# compatibility tests
find_program (BOND_CSHARP_COMPAT_TEST Bond.CompatibilityTest.exe
PATH_SUFFIXES net40 net45
PATH_SUFFIXES net45
NO_DEFAULT_PATH
PATHS
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/core/bin/debug"
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/core/bin/retail")
find_program (BOND_CSHARP_COMM_COMPAT_SERVER CommCompatServer.exe
PATH_SUFFIXES net40 net45
PATH_SUFFIXES net45
NO_DEFAULT_PATH
PATHS
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/comm/server/bin/debug"
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/comm/server/bin/retail")
find_program (BOND_CSHARP_COMM_COMPAT_CLIENT CommCompatClient.exe
PATH_SUFFIXES net40 net45
PATH_SUFFIXES net45
NO_DEFAULT_PATH
PATHS
"${CMAKE_CURRENT_SOURCE_DIR}/cs/test/compat/comm/client/bin/debug"

Просмотреть файл

@ -12,11 +12,6 @@
<PropertyGroup Condition="'$(BuildFramework)' == ''">
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<BuildFramework>net45</BuildFramework>
<DefineConstants>$(DefineConstants);NET45</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildFramework)' == 'net40'">
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<DefineConstants>$(DefineConstants);NET40</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<OutputPath>bin\$(BuildType)\$(BuildFramework)</OutputPath>

Просмотреть файл

@ -18,6 +18,5 @@
</ItemGroup>
<Target Name="AfterBuild">
<Copy SourceFiles="$(TargetPath);@(FileToCopy)" DestinationFolder="$(BOND_BINARY_PATH)\$(BuildFramework)" Condition="'$(BondRedistributable)' == 'true'" />
<MSBuild Condition="'$(BuildFramework)' == 'net45' And '$(OS)' != 'Unix' And '$(DontBuildNet40)' != 'true'" Projects="$(MSBuildProjectFile)" Properties="BuildFramework=net40" RunEachTargetSeparately="true" />
</Target>
</Project>

Просмотреть файл

@ -26,11 +26,6 @@
files, but there doesn't seem to be a good way to reference
dependent packages from MSBuild targets. Instead, we duplicate the
files in this package. They're pretty small. -->
<file target="build\net40" src="cs\build\nuget\Bond.Compiler.CSharp.props" />
<file target="build\net40" src="cs\build\nuget\Bond.Compiler.CSharp.targets" />
<file target="build\net40" src="cs\build\nuget\Common.props" />
<file target="build\net40" src="cs\build\nuget\Common.targets" />
<file target="build\net45" src="cs\build\nuget\Bond.Compiler.CSharp.props" />
<file target="build\net45" src="cs\build\nuget\Bond.Compiler.CSharp.targets" />
<file target="build\net45" src="cs\build\nuget\Common.props" />

Просмотреть файл

@ -24,19 +24,6 @@
<tags>Bond .NET C# serialization</tags>
</metadata>
<files>
<file target="lib\net40" src="net40\Bond.Attributes.dll" />
<file target="lib\net40" src="net40\Bond.Attributes.pdb" />
<file target="lib\net40" src="net40\Bond.Attributes.xml" />
<file target="lib\net40" src="net40\Bond.IO.dll" />
<file target="lib\net40" src="net40\Bond.IO.pdb" />
<file target="lib\net40" src="net40\Bond.IO.xml" />
<file target="lib\net40" src="net40\Bond.Reflection.dll" />
<file target="lib\net40" src="net40\Bond.Reflection.pdb" />
<file target="lib\net40" src="net40\Bond.Reflection.xml" />
<file target="lib\net40" src="net40\Bond.dll" />
<file target="lib\net40" src="net40\Bond.pdb" />
<file target="lib\net40" src="net40\Bond.xml" />
<file target="lib\net45" src="net45\Bond.Attributes.dll" />
<file target="lib\net45" src="net45\Bond.Attributes.pdb" />
<file target="lib\net45" src="net45\Bond.Attributes.xml" />

Просмотреть файл

@ -28,10 +28,6 @@
</dependencies>
</metadata>
<files>
<file target="lib\net40" src="net40\Bond.JSON.dll" />
<file target="lib\net40" src="net40\Bond.JSON.pdb" />
<file target="lib\net40" src="net40\Bond.JSON.xml" />
<file target="lib\net45" src="net45\Bond.JSON.dll" />
<file target="lib\net45" src="net45\Bond.JSON.pdb" />
<file target="lib\net45" src="net45\Bond.JSON.xml" />

Просмотреть файл

@ -10,7 +10,6 @@
<RootNamespace>Bond.Comm.Epoxy</RootNamespace>
<AssemblyName>Bond.Comm.Epoxy</AssemblyName>
<BondRedistributable>true</BondRedistributable>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<BondImportDirectory Include="..\interfaces" />

Просмотреть файл

@ -10,7 +10,6 @@
<RootNamespace>Bond.Comm</RootNamespace>
<AssemblyName>Bond.Comm.Interfaces</AssemblyName>
<BondRedistributable>true</BondRedistributable>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Compile Include="CodegenHelpers.cs" />

Просмотреть файл

@ -10,7 +10,6 @@
<RootNamespace>Bond.Comm.Layers</RootNamespace>
<AssemblyName>Bond.Comm.Layers</AssemblyName>
<BondRedistributable>true</BondRedistributable>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Compile Include="LayerStack.cs" />

Просмотреть файл

@ -10,7 +10,6 @@
<RootNamespace>Bond.Comm.Service</RootNamespace>
<AssemblyName>Bond.Comm.Service</AssemblyName>
<BondRedistributable>true</BondRedistributable>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Compile Include="properties\AssemblyInfo.cs" />

Просмотреть файл

@ -10,7 +10,6 @@
<RootNamespace>Bond.Comm.SimpleInMem</RootNamespace>
<AssemblyName>Bond.Comm.SimpleInMem</AssemblyName>
<BondRedistributable>true</BondRedistributable>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Compile Include="Processor\BatchProcessor.cs" />

Просмотреть файл

@ -20,9 +20,7 @@ namespace Bond
throw new ArgumentException(message);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static void ArgNotNull(object value, string paramName)
{
if (value == null)
@ -31,9 +29,7 @@ namespace Bond
}
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static void ArgRule(bool invariant, string message)
{
if (!invariant)

Просмотреть файл

@ -326,49 +326,37 @@ namespace Bond.IO
return result;
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static UInt16 EncodeZigzag16(Int16 value)
{
return (UInt16)((value << 1) ^ (value >> (sizeof(Int16) * 8 - 1)));
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static UInt32 EncodeZigzag32(Int32 value)
{
return (UInt32)((value << 1) ^ (value >> (sizeof(Int32) * 8 - 1)));
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static UInt64 EncodeZigzag64(Int64 value)
{
return (UInt64)((value << 1) ^ (value >> (sizeof(Int64) * 8 - 1)));
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static Int16 DecodeZigzag16(UInt16 value)
{
return (Int16)((value >> 1) ^ (-(value & 1)));
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static Int32 DecodeZigzag32(UInt32 value)
{
return (Int32)((value >> 1) ^ (-(value & 1)));
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static Int64 DecodeZigzag64(UInt64 value)
{
return (Int64)((value >> 1) ^ (UInt64)(-(Int64)(value & 1)));

Просмотреть файл

@ -185,9 +185,7 @@ namespace Bond.Protocols
/// <summary>
/// Write protocol magic number and version
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteVersion()
{
output.WriteUInt16(Magic);
@ -199,9 +197,7 @@ namespace Bond.Protocols
/// Start writing a struct
/// </summary>
/// <param name="metadata">Schema metadata</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructBegin(Metadata metadata)
{
if (version == 2)
@ -218,18 +214,14 @@ namespace Bond.Protocols
/// Start writing a base struct
/// </summary>
/// <param name="metadata">Base schema metadata</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseBegin(Metadata metadata)
{}
/// <summary>
/// End writing a struct
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructEnd()
{
output.WriteUInt8((Byte)BondDataType.BT_STOP);
@ -239,9 +231,7 @@ namespace Bond.Protocols
/// <summary>
/// End writing a base struct
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseEnd()
{
output.WriteUInt8((Byte)BondDataType.BT_STOP_BASE);
@ -253,9 +243,7 @@ namespace Bond.Protocols
/// <param name="type">Type of the field</param>
/// <param name="id">Identifier of the field</param>
/// <param name="metadata">Metadata of the field</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldBegin(BondDataType type, ushort id, Metadata metadata)
{
var fieldType = (uint)type;
@ -281,9 +269,7 @@ namespace Bond.Protocols
/// <param name="dataType">Type of the field</param>
/// <param name="id">Identifier of the field</param>
/// <param name="metadata">Metadata of the field</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldOmitted(BondDataType dataType, ushort id, Metadata metadata)
{}
@ -291,9 +277,7 @@ namespace Bond.Protocols
/// <summary>
/// End writing a field
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldEnd()
{}
@ -302,9 +286,7 @@ namespace Bond.Protocols
/// </summary>
/// <param name="count">Number of elements in the container</param>
/// <param name="elementType">Type of the elements</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerBegin(int count, BondDataType elementType)
{
if (2 == version && count < 7)
@ -324,9 +306,7 @@ namespace Bond.Protocols
/// <param name="count">Number of elements in the container</param>
/// <param name="keyType">Type of the keys</param>
/// /// <param name="valueType">Type of the values</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerBegin(int count, BondDataType keyType, BondDataType valueType)
{
output.WriteUInt8((byte)keyType);
@ -337,18 +317,14 @@ namespace Bond.Protocols
/// <summary>
/// End writing a container
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerEnd()
{}
/// <summary>
/// Write array of bytes verbatim
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBytes(ArraySegment<byte> data)
{
output.WriteBytes(data);
@ -360,9 +336,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt8
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt8(Byte value)
{
output.WriteUInt8(value);
@ -371,9 +345,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt16(UInt16 value)
{
output.WriteVarUInt16(value);
@ -382,9 +354,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt32(UInt32 value)
{
output.WriteVarUInt32(value);
@ -393,9 +363,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt64
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt64(UInt64 value)
{
output.WriteVarUInt64(value);
@ -404,9 +372,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int8
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt8(SByte value)
{
output.WriteUInt8((Byte)value);
@ -415,9 +381,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt16(Int16 value)
{
output.WriteVarUInt16(IntegerHelper.EncodeZigzag16(value));
@ -426,9 +390,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int32
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt32(Int32 value)
{
output.WriteVarUInt32(IntegerHelper.EncodeZigzag32(value));
@ -437,9 +399,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int64
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt64(Int64 value)
{
output.WriteVarUInt64(IntegerHelper.EncodeZigzag64(value));
@ -448,9 +408,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a float
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFloat(float value)
{
output.WriteFloat(value);
@ -459,9 +417,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a double
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteDouble(double value)
{
output.WriteDouble(value);
@ -470,9 +426,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a bool
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBool(bool value)
{
output.WriteUInt8((byte)(value ? 1 : 0));
@ -481,9 +435,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a UTF-8 string
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteString(string value)
{
if (value.Length == 0)
@ -501,9 +453,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a UTF-16 string
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteWString(string value)
{
if (value.Length == 0)
@ -572,17 +522,13 @@ namespace Bond.Protocols
/// <summary>
/// Clone the reader
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
CompactBinaryReader<I> ICloneable<CompactBinaryReader<I>>.Clone()
{
return new CompactBinaryReader<I>(input.Clone(), version);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
IClonableTaggedProtocolReader ICloneable<IClonableTaggedProtocolReader>.Clone()
{
return (this as ICloneable<CompactBinaryReader<I>>).Clone();
@ -594,9 +540,7 @@ namespace Bond.Protocols
/// Start reading a struct
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadStructBegin()
{
if (2 == version)
@ -609,9 +553,7 @@ namespace Bond.Protocols
/// Start reading a base of a struct
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadBaseBegin()
{ }
@ -619,9 +561,7 @@ namespace Bond.Protocols
/// End reading a struct
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadStructEnd()
{ }
@ -629,9 +569,7 @@ namespace Bond.Protocols
/// End reading a base of a struct
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadBaseEnd()
{ }
@ -642,9 +580,7 @@ namespace Bond.Protocols
/// or BT_STOP/BT_STOP_BASE if there is no more fields in current struct/base</param>
/// <param name="id">Out parameter set to the field identifier</param>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadFieldBegin(out BondDataType type, out ushort id)
{
uint raw = input.ReadUInt8();
@ -670,9 +606,7 @@ namespace Bond.Protocols
/// End reading a field
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadFieldEnd()
{ }
@ -682,9 +616,7 @@ namespace Bond.Protocols
/// <param name="count">An out parameter set to number of items in the container</param>
/// <param name="elementType">An out parameter set to type of container elements</param>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadContainerBegin(out int count, out BondDataType elementType)
{
var raw = input.ReadUInt8();
@ -703,9 +635,7 @@ namespace Bond.Protocols
/// <param name="keyType">An out parameter set to the type of map keys</param>
/// <param name="valueType">An out parameter set to the type of map values</param>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadContainerBegin(out int count, out BondDataType keyType, out BondDataType valueType)
{
keyType = (BondDataType)input.ReadUInt8();
@ -717,9 +647,7 @@ namespace Bond.Protocols
/// End reading a container
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadContainerEnd()
{ }
@ -731,9 +659,7 @@ namespace Bond.Protocols
/// Read an UInt8
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public byte ReadUInt8()
{
return input.ReadUInt8();
@ -743,9 +669,7 @@ namespace Bond.Protocols
/// Read an UInt16
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public ushort ReadUInt16()
{
return input.ReadVarUInt16();
@ -755,9 +679,7 @@ namespace Bond.Protocols
/// Read an UInt32
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public uint ReadUInt32()
{
return input.ReadVarUInt32();
@ -767,9 +689,7 @@ namespace Bond.Protocols
/// Read an UInt64
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public UInt64 ReadUInt64()
{
return input.ReadVarUInt64();
@ -779,9 +699,7 @@ namespace Bond.Protocols
/// Read an Int8
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public sbyte ReadInt8()
{
return (sbyte)input.ReadUInt8();
@ -791,9 +709,7 @@ namespace Bond.Protocols
/// Read an Int16
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public short ReadInt16()
{
return IntegerHelper.DecodeZigzag16(input.ReadVarUInt16());
@ -803,9 +719,7 @@ namespace Bond.Protocols
/// Read an Int32
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public int ReadInt32()
{
return IntegerHelper.DecodeZigzag32(input.ReadVarUInt32());
@ -815,9 +729,7 @@ namespace Bond.Protocols
/// Read an Int64
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public Int64 ReadInt64()
{
return IntegerHelper.DecodeZigzag64(input.ReadVarUInt64());
@ -827,9 +739,7 @@ namespace Bond.Protocols
/// Read a bool
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public bool ReadBool()
{
return input.ReadUInt8() != 0;
@ -839,9 +749,7 @@ namespace Bond.Protocols
/// Read a float
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public float ReadFloat()
{
return input.ReadFloat();
@ -851,9 +759,7 @@ namespace Bond.Protocols
/// Read a double
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public double ReadDouble()
{
return input.ReadDouble();
@ -863,9 +769,7 @@ namespace Bond.Protocols
/// Read a UTF-8 string
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public String ReadString()
{
var length = (int)input.ReadVarUInt32();
@ -876,9 +780,7 @@ namespace Bond.Protocols
/// Read a UTF-16 string
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public string ReadWString()
{
var length = (int)input.ReadVarUInt32();
@ -890,9 +792,7 @@ namespace Bond.Protocols
/// </summary>
/// <param name="count">Number of bytes to read</param>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public ArraySegment<byte> ReadBytes(int count)
{
return input.ReadBytes(count);

Просмотреть файл

@ -68,9 +68,7 @@ namespace Bond.Protocols
/// <summary>
/// Write protocol magic number and version
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteVersion()
{
}
@ -80,9 +78,7 @@ namespace Bond.Protocols
/// Start writing a struct
/// </summary>
/// <param name="metadata">Schema metadata</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructBegin(Metadata metadata)
{
LinkedListNode<UInt32> frameNode = lengths.AddLast(0);
@ -92,9 +88,7 @@ namespace Bond.Protocols
/// <summary>
/// End writing a struct
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructEnd()
{
CounterStackFrame frame = counterStack.Peek();
@ -113,18 +107,14 @@ namespace Bond.Protocols
/// Start writing a base struct
/// </summary>
/// <param name="metadata">Base schema metadata</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseBegin(Metadata metadata)
{ }
/// <summary>
/// End writing a base struct
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseEnd()
{
AddBytes(1);
@ -136,9 +126,7 @@ namespace Bond.Protocols
/// <param name="type">Type of the field</param>
/// <param name="id">Identifier of the field</param>
/// <param name="metadata">Metadata of the field</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldBegin(BondDataType type, ushort id, Metadata metadata)
{
if (id <= 5)
@ -161,9 +149,7 @@ namespace Bond.Protocols
/// <param name="dataType">Type of the field</param>
/// <param name="id">Identifier of the field</param>
/// <param name="metadata">Metadata of the field</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldOmitted(BondDataType dataType, ushort id, Metadata metadata)
{ }
@ -171,9 +157,7 @@ namespace Bond.Protocols
/// <summary>
/// End writing a field
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldEnd()
{ }
@ -182,9 +166,7 @@ namespace Bond.Protocols
/// </summary>
/// <param name="count">Number of elements in the container</param>
/// <param name="elementType">Type of the elements</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerBegin(int count, BondDataType elementType)
{
if (count < 7)
@ -204,9 +186,7 @@ namespace Bond.Protocols
/// <param name="count">Number of elements in the container</param>
/// <param name="keyType">Type of the keys</param>
/// <param name="valueType">Type of the values</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerBegin(int count, BondDataType keyType, BondDataType valueType)
{
AddBytes(2);
@ -216,18 +196,14 @@ namespace Bond.Protocols
/// <summary>
/// End writing a container
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerEnd()
{ }
/// <summary>
/// Write array of bytes verbatim
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBytes(ArraySegment<byte> data)
{
AddBytes(data.Count);
@ -239,9 +215,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt8
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt8(byte value)
{
AddBytes(1);
@ -250,9 +224,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt16(UInt16 value)
{
AddVarUInt16(value);
@ -261,9 +233,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt32(UInt32 value)
{
AddVarUInt32(value);
@ -272,9 +242,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt64
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt64(UInt64 value)
{
AddVarUInt64(value);
@ -283,9 +251,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int8
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt8(SByte value)
{
AddBytes(1);
@ -294,9 +260,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt16(Int16 value)
{
AddVarUInt16(IntegerHelper.EncodeZigzag16(value));
@ -305,9 +269,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int32
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt32(Int32 value)
{
AddVarUInt32(IntegerHelper.EncodeZigzag32(value));
@ -316,9 +278,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int64
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt64(Int64 value)
{
AddVarUInt64(IntegerHelper.EncodeZigzag64(value));
@ -327,9 +287,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a float
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFloat(float value)
{
AddBytes(4);
@ -338,9 +296,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a double
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteDouble(double value)
{
AddBytes(8);
@ -349,9 +305,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a bool
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBool(bool value)
{
AddBytes(1);
@ -360,9 +314,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a UTF-8 string
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteString(string value)
{
int size = Encoding.UTF8.GetByteCount(value);
@ -373,9 +325,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a UTF-16 string
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteWString(string value)
{
AddVarUInt32((uint)value.Length);

Просмотреть файл

@ -119,9 +119,7 @@ namespace Bond.Protocols
/// <summary>
/// Write protocol magic number and version
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteVersion()
{
output.WriteUInt16(Magic);
@ -133,9 +131,7 @@ namespace Bond.Protocols
/// Start writing a struct
/// </summary>
/// <param name="metadata">Schema metadata</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructBegin(Metadata metadata)
{}
@ -143,18 +139,14 @@ namespace Bond.Protocols
/// Start writing a base struct
/// </summary>
/// <param name="metadata">Base schema metadata</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseBegin(Metadata metadata)
{}
/// <summary>
/// End writing a struct
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructEnd()
{
output.WriteUInt8((Byte)BondDataType.BT_STOP);
@ -163,9 +155,7 @@ namespace Bond.Protocols
/// <summary>
/// End writing a base struct
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseEnd()
{
output.WriteUInt8((Byte)BondDataType.BT_STOP_BASE);
@ -177,9 +167,7 @@ namespace Bond.Protocols
/// <param name="type">Type of the field</param>
/// <param name="id">Identifier of the field</param>
/// <param name="metadata">Metadata of the field</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldBegin(BondDataType type, ushort id, Metadata metadata)
{
output.WriteUInt8((byte) type);
@ -193,9 +181,7 @@ namespace Bond.Protocols
/// <param name="dataType">Type of the field</param>
/// <param name="id">Identifier of the field</param>
/// <param name="metadata">Metadata of the field</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldOmitted(BondDataType dataType, ushort id, Metadata metadata)
{}
@ -203,9 +189,7 @@ namespace Bond.Protocols
/// <summary>
/// End writing a field
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldEnd()
{}
@ -214,9 +198,7 @@ namespace Bond.Protocols
/// </summary>
/// <param name="count">Number of elements in the container</param>
/// <param name="elementType">Type of the elements</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerBegin(int count, BondDataType elementType)
{
output.WriteUInt8((byte)elementType);
@ -229,9 +211,7 @@ namespace Bond.Protocols
/// <param name="count">Number of elements in the container</param>
/// <param name="keyType">Type of the keys</param>
/// /// <param name="valueType">Type of the values</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerBegin(int count, BondDataType keyType, BondDataType valueType)
{
output.WriteUInt8((byte)keyType);
@ -242,18 +222,14 @@ namespace Bond.Protocols
/// <summary>
/// End writing a container
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerEnd()
{}
/// <summary>
/// Write array of bytes verbatim
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBytes(ArraySegment<byte> data)
{
output.WriteBytes(data);
@ -265,9 +241,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt8
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt8(Byte value)
{
output.WriteUInt8(value);
@ -276,9 +250,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt16(UInt16 value)
{
output.WriteUInt16(value);
@ -287,9 +259,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt32(UInt32 value)
{
output.WriteUInt32(value);
@ -298,9 +268,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt64
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt64(UInt64 value)
{
output.WriteUInt64(value);
@ -309,9 +277,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int8
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt8(SByte value)
{
output.WriteUInt8((Byte)value);
@ -320,9 +286,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt16(Int16 value)
{
output.WriteUInt16((ushort)value);
@ -331,9 +295,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int32
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt32(Int32 value)
{
output.WriteUInt32((uint)value);
@ -342,9 +304,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int64
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt64(Int64 value)
{
output.WriteUInt64((ulong)value);
@ -353,9 +313,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a float
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFloat(float value)
{
output.WriteFloat(value);
@ -364,9 +322,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a double
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteDouble(double value)
{
output.WriteDouble(value);
@ -375,9 +331,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a bool
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBool(bool value)
{
output.WriteUInt8((byte)(value ? 1 : 0));
@ -386,9 +340,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a UTF-8 string
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteString(string value)
{
if (value.Length == 0)
@ -406,9 +358,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a UTF-16 string
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteWString(string value)
{
if (value.Length == 0)
@ -446,17 +396,13 @@ namespace Bond.Protocols
/// <summary>
/// Clone the reader
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
FastBinaryReader<I> ICloneable<FastBinaryReader<I>>.Clone()
{
return new FastBinaryReader<I>(input.Clone());
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
IClonableTaggedProtocolReader ICloneable<IClonableTaggedProtocolReader>.Clone()
{
return (this as ICloneable<FastBinaryReader<I>>).Clone();
@ -468,9 +414,7 @@ namespace Bond.Protocols
/// Start reading a struct
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadStructBegin()
{ }
@ -478,9 +422,7 @@ namespace Bond.Protocols
/// Start reading a base of a struct
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadBaseBegin()
{ }
@ -488,9 +430,7 @@ namespace Bond.Protocols
/// End reading a struct
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadStructEnd()
{ }
@ -498,9 +438,7 @@ namespace Bond.Protocols
/// End reading a base of a struct
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadBaseEnd()
{ }
@ -511,9 +449,7 @@ namespace Bond.Protocols
/// or BT_STOP/BT_STOP_BASE if there is no more fields in current struct/base</param>
/// <param name="id">Out parameter set to the field identifier</param>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadFieldBegin(out BondDataType type, out ushort id)
{
type = (BondDataType)input.ReadUInt8();
@ -528,9 +464,7 @@ namespace Bond.Protocols
/// End reading a field
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadFieldEnd()
{ }
@ -540,9 +474,7 @@ namespace Bond.Protocols
/// <param name="count">An out parameter set to number of items in the container</param>
/// <param name="elementType">An out parameter set to type of container elements</param>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadContainerBegin(out int count, out BondDataType elementType)
{
elementType = (BondDataType)input.ReadUInt8();
@ -556,9 +488,7 @@ namespace Bond.Protocols
/// <param name="keyType">An out parameter set to the type of map keys</param>
/// <param name="valueType">An out parameter set to the type of map values</param>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadContainerBegin(out int count, out BondDataType keyType, out BondDataType valueType)
{
keyType = (BondDataType)input.ReadUInt8();
@ -570,9 +500,7 @@ namespace Bond.Protocols
/// End reading a container
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadContainerEnd()
{ }
@ -584,9 +512,7 @@ namespace Bond.Protocols
/// Read an UInt8
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public byte ReadUInt8()
{
return input.ReadUInt8();
@ -596,9 +522,7 @@ namespace Bond.Protocols
/// Read an UInt16
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public ushort ReadUInt16()
{
return input.ReadUInt16();
@ -608,9 +532,7 @@ namespace Bond.Protocols
/// Read an UInt32
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public uint ReadUInt32()
{
return input.ReadUInt32();
@ -620,9 +542,7 @@ namespace Bond.Protocols
/// Read an UInt64
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public UInt64 ReadUInt64()
{
return input.ReadUInt64();
@ -632,9 +552,7 @@ namespace Bond.Protocols
/// Read an Int8
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public sbyte ReadInt8()
{
return (sbyte)input.ReadUInt8();
@ -644,9 +562,7 @@ namespace Bond.Protocols
/// Read an Int16
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public short ReadInt16()
{
return (short)input.ReadUInt16();
@ -656,9 +572,7 @@ namespace Bond.Protocols
/// Read an Int32
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public int ReadInt32()
{
return (int)input.ReadUInt32();
@ -668,9 +582,7 @@ namespace Bond.Protocols
/// Read an Int64
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public long ReadInt64()
{
return (long)input.ReadUInt64();
@ -680,9 +592,7 @@ namespace Bond.Protocols
/// Read a bool
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public bool ReadBool()
{
return input.ReadUInt8() != 0;
@ -692,9 +602,7 @@ namespace Bond.Protocols
/// Read a float
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public float ReadFloat()
{
return input.ReadFloat();
@ -704,9 +612,7 @@ namespace Bond.Protocols
/// Read a double
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public double ReadDouble()
{
return input.ReadDouble();
@ -716,9 +622,7 @@ namespace Bond.Protocols
/// Read a UTF-8 string
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public String ReadString()
{
var length = (int)input.ReadVarUInt32();
@ -729,9 +633,7 @@ namespace Bond.Protocols
/// Read a UTF-16 string
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public string ReadWString()
{
var length = (int)input.ReadVarUInt32();
@ -743,9 +645,7 @@ namespace Bond.Protocols
/// </summary>
/// <param name="count">Number of bytes to read</param>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public ArraySegment<byte> ReadBytes(int count)
{
return input.ReadBytes(count);

Просмотреть файл

@ -85,9 +85,7 @@ namespace Bond.Protocols
/// <summary>
/// Write protocol magic number and version
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteVersion()
{
output.WriteUInt16(Magic);
@ -97,34 +95,22 @@ namespace Bond.Protocols
#region Complex Types
#region Unused in tagged protocol
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldBegin(BondDataType type, ushort id, Metadata metadata) { }
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldEnd() { }
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructBegin(Metadata metadata) { }
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseBegin(Metadata metadata) { }
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructEnd() { }
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseEnd() { }
#endregion
@ -135,9 +121,7 @@ namespace Bond.Protocols
/// <param name="dataType">Type of the field</param>
/// <param name="id">Identifier of the field</param>
/// <param name="metadata">Metadata of the field</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldOmitted(BondDataType dataType, ushort id, Metadata metadata)
{
// Simple doesn't support omitting fields so instead we write the default value
@ -200,9 +184,7 @@ namespace Bond.Protocols
/// </summary>
/// <param name="count">Number of elements in the container</param>
/// <param name="elementType">Type of the elements</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerBegin(int count, BondDataType elementType)
{
WriteLength(count);
@ -214,9 +196,7 @@ namespace Bond.Protocols
/// <param name="count">Number of elements in the container</param>
/// <param name="keyType">Type of the keys</param>
/// /// <param name="valueType">Type of the values</param>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerBegin(int count, BondDataType keyType, BondDataType valueType)
{
WriteLength(count);
@ -225,9 +205,7 @@ namespace Bond.Protocols
/// <summary>
/// End writing a container
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerEnd() { }
#endregion
@ -236,9 +214,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt8
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt8(Byte value)
{
output.WriteUInt8(value);
@ -247,9 +223,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt16(UInt16 value)
{
output.WriteUInt16(value);
@ -258,9 +232,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt32
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt32(UInt32 value)
{
output.WriteUInt32(value);
@ -269,9 +241,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an UInt64
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt64(UInt64 value)
{
output.WriteUInt64(value);
@ -280,9 +250,7 @@ namespace Bond.Protocols
/// <summary>
/// Write array of bytes verbatim
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBytes(ArraySegment<byte> data)
{
output.WriteBytes(data);
@ -291,9 +259,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int8
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt8(SByte value)
{
output.WriteUInt8(unchecked((Byte)value));
@ -302,9 +268,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int16
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt16(Int16 value)
{
output.WriteUInt16(unchecked((UInt16) value));
@ -313,9 +277,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int32
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt32(Int32 value)
{
output.WriteUInt32(unchecked((UInt32)value));
@ -324,9 +286,7 @@ namespace Bond.Protocols
/// <summary>
/// Write an Int64
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt64(Int64 value)
{
output.WriteUInt64(unchecked((UInt64)value));
@ -335,9 +295,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a float
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFloat(float value)
{
output.WriteFloat(value);
@ -346,9 +304,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a double
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteDouble(double value)
{
output.WriteDouble(value);
@ -356,9 +312,7 @@ namespace Bond.Protocols
/// <summary> write bool, extending the stream if necessary and possible
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBool(bool value)
{
output.WriteUInt8((byte)(value ? 1 : 0));
@ -367,9 +321,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a UTF-8 string
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteString(string value)
{
if (value.Length == 0)
@ -387,9 +339,7 @@ namespace Bond.Protocols
/// <summary>
/// Write a UTF-16 string
/// </summary>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteWString(string value)
{
if (value.Length == 0)
@ -404,9 +354,7 @@ namespace Bond.Protocols
}
#endregion
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
void WriteLength(int value)
{
if (version == 2)
@ -429,17 +377,13 @@ namespace Bond.Protocols
this.version = version;
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
SimpleBinaryReader<I> ICloneable<SimpleBinaryReader<I>>.Clone()
{
return new SimpleBinaryReader<I>(input.Clone(), version);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
IClonableUntaggedProtocolReader ICloneable<IClonableUntaggedProtocolReader>.Clone()
{
return (this as ICloneable<SimpleBinaryReader<I>>).Clone();
@ -447,9 +391,7 @@ namespace Bond.Protocols
#region Complex types
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public bool ReadFieldOmitted()
{
return false;
@ -460,9 +402,7 @@ namespace Bond.Protocols
/// </summary>
/// <returns>Number of elements</returns>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public int ReadContainerBegin()
{
return ReadLength();
@ -472,9 +412,7 @@ namespace Bond.Protocols
/// End reading a container
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void ReadContainerEnd()
{}
@ -486,17 +424,13 @@ namespace Bond.Protocols
/// Read an UInt8
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public byte ReadUInt8()
{
return input.ReadUInt8();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipUInt8()
{
input.SkipBytes(1);
@ -506,17 +440,13 @@ namespace Bond.Protocols
/// Read an UInt16
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public ushort ReadUInt16()
{
return input.ReadUInt16();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipUInt16()
{
input.SkipBytes(2);
@ -526,17 +456,13 @@ namespace Bond.Protocols
/// Read an UInt32
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public uint ReadUInt32()
{
return input.ReadUInt32();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipUInt32()
{
input.SkipBytes(4);
@ -546,17 +472,13 @@ namespace Bond.Protocols
/// Read an UInt64
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public UInt64 ReadUInt64()
{
return input.ReadUInt64();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipUInt64()
{
input.SkipBytes(8);
@ -566,17 +488,13 @@ namespace Bond.Protocols
/// Read an Int8
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public sbyte ReadInt8()
{
return unchecked((sbyte)input.ReadUInt8());
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipInt8()
{
input.SkipBytes(1);
@ -586,17 +504,13 @@ namespace Bond.Protocols
/// Read an Int16
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public short ReadInt16()
{
return unchecked((short)input.ReadUInt16());
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipInt16()
{
input.SkipBytes(2);
@ -606,17 +520,13 @@ namespace Bond.Protocols
/// Read an Int32
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public int ReadInt32()
{
return unchecked((int)input.ReadUInt32());
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipInt32()
{
input.SkipBytes(4);
@ -626,17 +536,13 @@ namespace Bond.Protocols
/// Read an Int64
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public Int64 ReadInt64()
{
return unchecked((Int64)input.ReadUInt64());
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipInt64()
{
input.SkipBytes(8);
@ -646,17 +552,13 @@ namespace Bond.Protocols
/// Read an bool
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public bool ReadBool()
{
return input.ReadUInt8() != 0;
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipBool()
{
input.SkipBytes(1);
@ -666,17 +568,13 @@ namespace Bond.Protocols
/// Read an float
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public float ReadFloat()
{
return input.ReadFloat();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipFloat()
{
input.SkipBytes(4);
@ -686,17 +584,13 @@ namespace Bond.Protocols
/// Read an double
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public double ReadDouble()
{
return input.ReadDouble();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipDouble()
{
input.SkipBytes(8);
@ -706,18 +600,14 @@ namespace Bond.Protocols
/// Read a UTF-8 string
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public String ReadString()
{
var length = ReadLength();
return length == 0 ? string.Empty : input.ReadString(Encoding.UTF8, length);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipString()
{
input.SkipBytes(ReadLength());
@ -727,18 +617,14 @@ namespace Bond.Protocols
/// Read a UTF-16 string
/// </summary>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public string ReadWString()
{
var length = ReadLength();
return length == 0 ? string.Empty : input.ReadString(Encoding.Unicode, length << 1);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipWString()
{
input.SkipBytes(ReadLength() << 1);
@ -749,17 +635,13 @@ namespace Bond.Protocols
/// </summary>
/// <param name="count">Number of bytes to read</param>
/// <exception cref="EndOfStreamException"/>
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public ArraySegment<byte> ReadBytes(int count)
{
return input.ReadBytes(count);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void SkipBytes(int count)
{
input.SkipBytes(count);
@ -767,9 +649,7 @@ namespace Bond.Protocols
#endregion
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
int ReadLength()
{
return (int)((version == 2) ? input.ReadVarUInt32() : input.ReadUInt32());

Просмотреть файл

@ -48,17 +48,13 @@ namespace Bond.Protocols
get { return reader.NamespaceURI; }
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void Read()
{
reader.Read();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void Skip()
{
reader.Skip();

Просмотреть файл

@ -53,59 +53,45 @@ namespace Bond.Protocols
#region Struct
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructBegin(Metadata metadata)
{
writer.WriteStartElement(metadata.GetXmlName());
PushNamespace(metadata);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseBegin(Metadata metadata)
{
PushNamespace(metadata);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructEnd()
{
PopNamespace();
writer.WriteEndElement();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseEnd()
{
PopNamespace();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldBegin(BondDataType dataType, ushort id, Metadata metadata)
{
writer.WriteStartElement(Prefix, metadata.name, null);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldEnd()
{
writer.WriteEndElement();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldOmitted(BondDataType dataType, ushort id, Metadata metadata)
{ }
@ -113,37 +99,27 @@ namespace Bond.Protocols
#region Containers
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerBegin(int count, BondDataType elementType)
{ }
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerBegin(int count, BondDataType keyType, BondDataType valueType)
{ }
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteContainerEnd()
{ }
#region ITextProtocolWriter
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteItemBegin()
{
writer.WriteStartElement("Item");
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteItemEnd()
{
writer.WriteEndElement();
@ -155,81 +131,61 @@ namespace Bond.Protocols
#region Scalars
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt8(sbyte value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt16(short value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt32(int value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt64(long value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt8(byte value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt16(ushort value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt32(uint value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt64(ulong value)
{
writer.WriteValue(value.ToString());
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFloat(float value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteDouble(double value)
{
writer.WriteValue(value);
@ -247,25 +203,19 @@ namespace Bond.Protocols
}
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBool(bool value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteString(string value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteWString(string value)
{
writer.WriteValue(value);

Просмотреть файл

@ -9,7 +9,6 @@
<RootNamespace>Bond.Grpc</RootNamespace>
<AssemblyName>Bond.Grpc</AssemblyName>
<BondRedistributable>true</BondRedistributable>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Compile Include="Marshaller.cs" />

Просмотреть файл

@ -29,9 +29,6 @@
<Reference Include="Newtonsoft.Json" Condition="'$(TargetFrameworkVersion)' == 'v4.5'">
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json" Condition="'$(TargetFrameworkVersion)' == 'v4.0'">
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

Просмотреть файл

@ -68,10 +68,8 @@ namespace Bond.Protocols
{
get { return reader.LinePosition; }
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void Read()
{
eof = !reader.Read();

Просмотреть файл

@ -38,52 +38,38 @@ namespace Bond.Protocols
#region Struct
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructBegin(Metadata metadata)
{
writer.WriteStartObject();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteStructEnd()
{
writer.WriteEndObject();
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseBegin(Metadata metadata)
{}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBaseEnd()
{}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldBegin(BondDataType type, ushort id, Metadata metadata)
{
string name;
writer.WritePropertyName(metadata.attributes.TryGetValue(NameAttribute, out name) ? name : metadata.name);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldEnd()
{}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFieldOmitted(BondDataType type, ushort id, Metadata metadata)
{}
@ -110,9 +96,7 @@ namespace Bond.Protocols
#region Scalars
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteBool(bool value)
{
writer.WriteValue(value);
@ -127,97 +111,73 @@ namespace Bond.Protocols
}
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteDouble(double value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteFloat(float value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt16(short value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt32(int value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt64(long value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteInt8(sbyte value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteString(string value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt16(ushort value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt32(uint value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt64(ulong value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteUInt8(byte value)
{
writer.WriteValue(value);
}
#if NET45
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void WriteWString(string value)
{
writer.WriteValue(value);

Просмотреть файл

@ -1,62 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Even though this file is compiled conditionally, the #if is necessary to unconfuse resharper
#if NET40
namespace Bond.Internal.Reflection
{
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
// Common reflection interface implementation for .NET 4.0
internal static class Reflection40
{
const BindingFlags AllDeclared = BindingFlags.NonPublic | BindingFlags.Public |
BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
public static Type GetTypeInfo(this Type type)
{
return type;
}
public static Type[] GetGenericParameters(this Type type)
{
return type.GetGenericArguments();
}
public static IEnumerable<ConstructorInfo> GetDeclaredConstructors(this Type type)
{
return type.GetConstructors(AllDeclared);
}
public static IEnumerable<FieldInfo> GetDeclaredFields(this Type type)
{
return type.GetFields(AllDeclared);
}
public static IEnumerable<PropertyInfo> GetDeclaredProperties(this Type type)
{
return type.GetProperties(AllDeclared);
}
public static PropertyInfo GetDeclaredProperty(this Type type, string name)
{
return type.GetProperty(name, AllDeclared);
}
public static IEnumerable<MethodInfo> GetDeclaredMethods(this Type type, string name)
{
return type.GetMethods(AllDeclared).Where(m => m.Name == name);
}
public static object GetValue(this PropertyInfo property, object o)
{
return property.GetValue(o, null);
}
}
}
#endif

Просмотреть файл

@ -1,9 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Even though this file is compiled conditionally, the #if is necessary to unconfuse resharper
#if !NET40
namespace Bond.Internal.Reflection
{
using System;
@ -59,5 +56,3 @@ namespace Bond.Internal.Reflection
}
}
}
#endif

Просмотреть файл

@ -13,7 +13,6 @@
<ItemGroup>
<Compile Include="properties\AssemblyInfo.cs" />
<Compile Include="Reflection.cs" />
<Compile Include="Reflection40.cs" Condition="'$(TargetFrameworkVersion)' == 'v4.0'" />
<Compile Include="Reflection45.cs" Condition="'$(TargetFrameworkVersion)' == 'v4.5'" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)\..\..\build\internal\Common.Internal.targets" />

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildFramework Condition="'$(Configuration)' == 'Net40'">net40</BuildFramework>
<BuildFramework Condition="'$(Configuration)' == 'Net45'">net45</BuildFramework>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath32)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildThisFileDirectory)\..\..\..\build\internal\Common.Internal.props" />

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildFramework Condition="'$(Configuration)' == 'Net40'">net40</BuildFramework>
<BuildFramework Condition="'$(Configuration)' == 'Net45'">net45</BuildFramework>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath32)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildThisFileDirectory)\..\..\..\build\internal\Common.Internal.props" />

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildFramework Condition="'$(Configuration)' == 'Net40'">net40</BuildFramework>
<BuildFramework Condition="'$(Configuration)' == 'Net45'">net45</BuildFramework>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath32)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildThisFileDirectory)\..\..\build\internal\Common.Internal.props" />
@ -15,7 +15,6 @@
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<DependentOutputPath>$(OutputPath)</DependentOutputPath>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<IntermediateOutputPath>$(IntermediateOutputPath)\Properties\</IntermediateOutputPath>
@ -89,9 +88,6 @@
<Reference Include="Newtonsoft.Json" Condition="'$(TargetFrameworkVersion)' == 'v4.5'">
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json" Condition="'$(TargetFrameworkVersion)' == 'v4.0'">
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Bond.Attributes">

Просмотреть файл

@ -9,7 +9,6 @@
<RootNamespace>CommCompatClient</RootNamespace>
<AssemblyName>CommCompatClient</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

Просмотреть файл

@ -9,7 +9,6 @@
<RootNamespace>CommCompatServer</RootNamespace>
<AssemblyName>CommCompatServer</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

Просмотреть файл

@ -9,7 +9,6 @@
<RootNamespace>CommCompatShared</RootNamespace>
<AssemblyName>CommCompatShared</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

Просмотреть файл

@ -9,7 +9,6 @@
<RootNamespace>GrpcCompatClient</RootNamespace>
<AssemblyName>GrpcCompatClient</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Reference Include="Grpc.Core">

Просмотреть файл

@ -9,7 +9,6 @@
<RootNamespace>GrpcCompatServer</RootNamespace>
<AssemblyName>GrpcCompatServer</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Reference Include="Grpc.Core">

Просмотреть файл

@ -9,7 +9,6 @@
<RootNamespace>GrpcCompatShared</RootNamespace>
<AssemblyName>GrpcCompatShared</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<ItemGroup>
<Reference Include="Grpc.Core">

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildFramework Condition="'$(Configuration)' == 'Net40'">net40</BuildFramework>
<BuildFramework Condition="'$(Configuration)' == 'Net45'">net45</BuildFramework>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath32)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildThisFileDirectory)\..\..\build\internal\Common.Internal.props" />
@ -20,7 +20,7 @@
<IntermediateOutputPath>$(IntermediateOutputPath)\Properties\</IntermediateOutputPath>
<OutputPath>$(OutputPath)\Properties\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Net40' ">
<PropertyGroup Condition=" '$(Configuration)' == 'Net45' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Fields' ">
<IntermediateOutputPath>$(IntermediateOutputPath)\Fields\</IntermediateOutputPath>
@ -56,8 +56,7 @@
<Compile Include="Util.cs" />
<Compile Include="XmlTests.cs" />
<BondCodegen Include="Aliases.bond">
<Options Condition="'$(TargetFrameworkVersion)' == 'v4.5'">$(BondOptions) --using="Lazy=Lazy&lt;{0}&gt;" --using="OrderedSet=SortedSet&lt;{0}&gt;" --using="Decimal=decimal" --using="EnumString=Alias.EnumString&lt;{0}&gt;" --using="Array={0}[]" --using=ArrayBlob=byte[] --using="CustomList=UnitTest.Aliases.SomeCustomList&lt;{0}&gt;"</Options>
<Options Condition="'$(TargetFrameworkVersion)' == 'v4.0'">$(BondOptions) --using="Lazy=Lazy&lt;{0}&gt;" --using="OrderedSet=SortedSet&lt;{0}&gt;" --using="Decimal=decimal" --using="EnumString=Alias.EnumString&lt;{0}&gt;" --using="Array={0}[]" --using=ArrayBlob=byte[] --using="CustomList=UnitTest.Aliases.SomeCustomList&lt;{0}&gt;"</Options>
<Options>$(BondOptions) --using="Lazy=Lazy&lt;{0}&gt;" --using="OrderedSet=SortedSet&lt;{0}&gt;" --using="Decimal=decimal" --using="EnumString=Alias.EnumString&lt;{0}&gt;" --using="Array={0}[]" --using=ArrayBlob=byte[] --using="CustomList=UnitTest.Aliases.SomeCustomList&lt;{0}&gt;"</Options>
</BondCodegen>
<BondCodegen Include="NamespaceConflict.bond" />
<BondCodegen Include="NamespaceConflictBond.bond" />
@ -93,9 +92,6 @@
<Reference Include="Newtonsoft.Json" Condition="'$(TargetFrameworkVersion)' == 'v4.5'">
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json" Condition="'$(TargetFrameworkVersion)' == 'v4.0'">
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Bond.Attributes">

Просмотреть файл

@ -12,7 +12,6 @@
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<DependentOutputPath>$(OutputPath)</DependentOutputPath>
<DontBuildNet40>true</DontBuildNet40>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<IntermediateOutputPath>$(IntermediateOutputPath)\Properties\</IntermediateOutputPath>

Просмотреть файл

@ -847,8 +847,6 @@ how to achieve the best performance.
amortized. The canonical use case for an untagged protocol is record-based
data storage.
6. Using .NET 4.5 will give better performance than 4.0.
Runtime schema
==============
@ -1528,16 +1526,16 @@ namespace).
This table lists which frameworks are targeted by the Bond assemblies.
This table is accurate for Bond NuGet packages 5.1.0 and later and Bond Comm
0.9.0 and later.
This table is accurate for Bond NuGet packages 6.0.0 and later and Bond Comm
0.12.0 and later.
| Assembly | .NET 4.0 | .NET 4.5 | Profile78 | .NET Standard 1.0 | .NET Standard 1.3 | .NET Standard 1.6 |
|--------------------------|----------|----------|-----------|-------------------|-------------------|-------------------|
| Bond.Attributes.dll | Yes | Yes | Yes | Yes | ← | Yes |
| Bond.Reflection.dll | Yes | Yes | Yes | Yes | ← | Yes |
| Bond.dll | Yes | Yes | Yes | Yes | ← | Yes |
| Bond.JSON.dll | Yes | Yes | No | Yes | ← | Yes |
| Bond.IO.dll | Win only | Win only | No | No | Win only | Win only |
| Bond.Attributes.dll | No | Yes | Yes | Yes | ← | Yes |
| Bond.Reflection.dll | No | Yes | Yes | Yes | ← | Yes |
| Bond.dll | No | Yes | Yes | Yes | ← | Yes |
| Bond.JSON.dll | No | Yes | No | Yes | ← | Yes |
| Bond.IO.dll | No | Win only | No | No | Win only | Win only |
| Bond.Comm.Interfaces.dll | No | Yes | Yes | ← | ← | ← |
| Bond.Comm.Layers.dll | No | Yes | Yes | ← | ← | ← |
| Bond.Comm.Services.dll | No | Yes | Yes | ← | ← | ← |