From 46d741a287ca0dd8bbf678a61ff2ac0125ea23df Mon Sep 17 00:00:00 2001 From: Mikhail Mitrofanov Date: Sat, 16 Aug 2025 18:30:05 +0300 Subject: [PATCH] Changing references --- mROA.Benchmark/CborExtensions.cs | 2 ++ mROA.Benchmark/ILoadTest.cs | 15 ++++++++ mROA.Benchmark/IPage.cs | 11 ++++++ mROA.Benchmark/IPrinter.cs | 51 ++++++++++++++++++++++++++++ mROA.Benchmark/IPrinterFactory.cs | 15 ++++++++ mROA.Benchmark/RequestWriter.cs | 2 ++ mROA.Benchmark/mROA.Benchmark.csproj | 15 +++----- 7 files changed, 101 insertions(+), 10 deletions(-) create mode 100644 mROA.Benchmark/ILoadTest.cs create mode 100644 mROA.Benchmark/IPage.cs create mode 100644 mROA.Benchmark/IPrinter.cs create mode 100644 mROA.Benchmark/IPrinterFactory.cs diff --git a/mROA.Benchmark/CborExtensions.cs b/mROA.Benchmark/CborExtensions.cs index 1cbedc5..cbb8f08 100644 --- a/mROA.Benchmark/CborExtensions.cs +++ b/mROA.Benchmark/CborExtensions.cs @@ -3,6 +3,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using mROA.Implementation; +namespace mROA.Benchmark; + public static class CborExtensions { public static unsafe void WriteToCbor(this RequestId id, CborWriter writer) diff --git a/mROA.Benchmark/ILoadTest.cs b/mROA.Benchmark/ILoadTest.cs new file mode 100644 index 0000000..8c1e462 --- /dev/null +++ b/mROA.Benchmark/ILoadTest.cs @@ -0,0 +1,15 @@ +using mROA.Abstract; +using mROA.Implementation.Attributes; + +namespace mROA.Benchmark +{ + [SharedObjectInterface] + public interface ILoadTest : IShared + { + Task Next(int last); + int Last(int next); + void C(); + void A(); + Task AsyncTest(CancellationToken token = default); + } +} \ No newline at end of file diff --git a/mROA.Benchmark/IPage.cs b/mROA.Benchmark/IPage.cs new file mode 100644 index 0000000..6d387ee --- /dev/null +++ b/mROA.Benchmark/IPage.cs @@ -0,0 +1,11 @@ +using mROA.Abstract; +using mROA.Implementation.Attributes; + +namespace mROA.Benchmark +{ + [SharedObjectInterface] + public interface IPage : IShared + { + byte[] GetData(); + } +} \ No newline at end of file diff --git a/mROA.Benchmark/IPrinter.cs b/mROA.Benchmark/IPrinter.cs new file mode 100644 index 0000000..03d9620 --- /dev/null +++ b/mROA.Benchmark/IPrinter.cs @@ -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 Print(string text, bool someParameter, RequestContext context, CancellationToken cancellationToken); + event Action 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); + } + } +} \ No newline at end of file diff --git a/mROA.Benchmark/IPrinterFactory.cs b/mROA.Benchmark/IPrinterFactory.cs new file mode 100644 index 0000000..e6e55dd --- /dev/null +++ b/mROA.Benchmark/IPrinterFactory.cs @@ -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(); + } +} \ No newline at end of file diff --git a/mROA.Benchmark/RequestWriter.cs b/mROA.Benchmark/RequestWriter.cs index b9cd279..35817f0 100644 --- a/mROA.Benchmark/RequestWriter.cs +++ b/mROA.Benchmark/RequestWriter.cs @@ -2,6 +2,8 @@ using System.Formats.Cbor; using BenchmarkDotNet.Attributes; using mROA.Implementation; +namespace mROA.Benchmark; + [MemoryDiagnoser] public class RequestWriter { diff --git a/mROA.Benchmark/mROA.Benchmark.csproj b/mROA.Benchmark/mROA.Benchmark.csproj index 4e38730..b513131 100644 --- a/mROA.Benchmark/mROA.Benchmark.csproj +++ b/mROA.Benchmark/mROA.Benchmark.csproj @@ -9,19 +9,14 @@ - - - + + - - ..\..\..\..\.nuget\packages\system.formats.cbor\9.0.7\lib\net9.0\System.Formats.Cbor.dll - - - - - + + +