Changing references

This commit is contained in:
2025-08-16 18:30:05 +03:00
parent 24d346795d
commit 46d741a287
7 changed files with 101 additions and 10 deletions
+2
View File
@@ -3,6 +3,8 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using mROA.Implementation; using mROA.Implementation;
namespace mROA.Benchmark;
public static class CborExtensions public static class CborExtensions
{ {
public static unsafe void WriteToCbor(this RequestId id, CborWriter writer) public static unsafe void WriteToCbor(this RequestId id, CborWriter writer)
+15
View File
@@ -0,0 +1,15 @@
using mROA.Abstract;
using mROA.Implementation.Attributes;
namespace mROA.Benchmark
{
[SharedObjectInterface]
public interface ILoadTest : IShared
{
Task<int> Next(int last);
int Last(int next);
void C();
void A();
Task AsyncTest(CancellationToken token = default);
}
}
+11
View File
@@ -0,0 +1,11 @@
using mROA.Abstract;
using mROA.Implementation.Attributes;
namespace mROA.Benchmark
{
[SharedObjectInterface]
public interface IPage : IShared
{
byte[] GetData();
}
}
+51
View File
@@ -0,0 +1,51 @@
using mROA.Abstract;
using mROA.Implementation;
using mROA.Implementation.Attributes;
namespace mROA.Benchmark
{
[SharedObjectInterface]
public partial interface IPrinter : IDisposable, IShared
{
double Resource { get; set; }
string GetName();
Task<IPage> Print(string text, bool someParameter, RequestContext context, CancellationToken cancellationToken);
event Action<IPage, RequestContext> OnPrint;
[Untrusted]
Task SomeoneIsApproaching(string humanName);
Task SetFingerPrint(int[] fingerPrint);
Task IntTest(MyData data);
}
public class MyData
{
public int Id { get; set; }
public string Name { get; set; }
public double Score { get; set; }
public override string ToString()
{
return $"{{{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(Score)}: {Score}}}";
}
protected bool Equals(MyData other)
{
return Id == other.Id && Name == other.Name && Score.Equals(other.Score);
}
public override bool Equals(object obj)
{
if (obj is null) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != GetType()) return false;
return Equals((MyData)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(Id, Name, Score);
}
}
}
+15
View File
@@ -0,0 +1,15 @@
using mROA.Abstract;
using mROA.Implementation.Attributes;
namespace mROA.Benchmark
{
[SharedObjectInterface]
public interface IPrinterFactory : IShared
{
IPrinter Create(string printerName);
void Register(IPrinter printer);
IPrinter GetPrinterByName(string printerName);
IPrinter GetFirstPrinter();
string[] CollectAllNames();
}
}
+2
View File
@@ -2,6 +2,8 @@ using System.Formats.Cbor;
using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Attributes;
using mROA.Implementation; using mROA.Implementation;
namespace mROA.Benchmark;
[MemoryDiagnoser] [MemoryDiagnoser]
public class RequestWriter public class RequestWriter
{ {
+6 -11
View File
@@ -9,19 +9,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Example.Shared\Example.Shared.csproj" /> <PackageReference Include="BenchmarkDotNet" Version="0.15.2"/>
<PackageReference Include="System.Formats.Cbor" Version="9.0.8"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\mROA.Cbor\mROA.Cbor.csproj"/> <ProjectReference Include="..\mROA.Cbor\mROA.Cbor.csproj"/>
<ProjectReference Include="..\mROA.Codegen\mROA.Codegen.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
<ProjectReference Include="..\mROA\mROA.csproj"/> <ProjectReference Include="..\mROA\mROA.csproj"/>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="System.Formats.Cbor">
<HintPath>..\..\..\..\.nuget\packages\system.formats.cbor\9.0.7\lib\net9.0\System.Formats.Cbor.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.2" />
</ItemGroup>
</Project> </Project>