From 4e4cdc4762b5b240c1934fd66cb999cb651735f8 Mon Sep 17 00:00:00 2001 From: Mikhail Mitrofanov Date: Tue, 18 Feb 2025 22:06:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B2=D1=8B=D0=B9=20=D0=BF?= =?UTF-8?q?=D1=83=D0=BB=20=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Example.Backend/LoadTestImp.cs | 1 - Example.Backend/PrinterFactory.cs | 1 - Example.Frontend/Program.cs | 39 ++++++++++--------- Example.Shared/ILoadTest.cs | 3 +- Example.Shared/IPage.cs | 1 - Example.Shared/IPrinterFactory.cs | 2 - mROA.Benchmark/Program.cs | 3 +- mROA/Abstract/ISerialisationModule.cs | 5 +-- .../ExceptionCommandExecution.cs | 3 +- .../CreativeSerializationModuleProducer.cs | 2 - .../JsonFrontendSerialisationModule.cs | 4 -- .../Frontend/NetworkFrontendBridge.cs | 2 - .../StreamBasedFrontendInteractionModule.cs | 2 - .../JsonSerializationToolkit.cs | 12 +++--- mROA/Implementation/NetworkMessage.cs | 13 +++---- .../NextGenerationInteractionModule.cs | 17 ++++---- .../Implementation/RemoteContextRepository.cs | 19 +++++---- mROA/Implementation/RemoteObjectBase.cs | 39 ++++++++----------- mROA/Implementation/RepresentationModule.cs | 38 +++++++++++------- mROA/Implementation/SharedObject.cs | 15 ++++--- .../StaticRepresentationModuleProducer.cs | 8 ++-- 21 files changed, 111 insertions(+), 118 deletions(-) diff --git a/Example.Backend/LoadTestImp.cs b/Example.Backend/LoadTestImp.cs index f75b2bb..e0ea125 100644 --- a/Example.Backend/LoadTestImp.cs +++ b/Example.Backend/LoadTestImp.cs @@ -1,5 +1,4 @@ using Example.Shared; -using mROA.Implementation; using mROA.Implementation.Attributes; namespace Example.Backend; diff --git a/Example.Backend/PrinterFactory.cs b/Example.Backend/PrinterFactory.cs index 10ac15c..e71503f 100644 --- a/Example.Backend/PrinterFactory.cs +++ b/Example.Backend/PrinterFactory.cs @@ -1,4 +1,3 @@ -using Example.Backend; using Example.Shared; using mROA.Implementation; using mROA.Implementation.Attributes; diff --git a/Example.Frontend/Program.cs b/Example.Frontend/Program.cs index a0996ba..1254e41 100644 --- a/Example.Frontend/Program.cs +++ b/Example.Frontend/Program.cs @@ -1,4 +1,6 @@ -using System.Net; +using System.Diagnostics; +using System.Net; +using System.Text; using Example.Frontend; using Example.Shared; using mROA.Codegen; @@ -56,22 +58,21 @@ var names = factory.CollectAllNames(); Thread.Sleep(100); Console.WriteLine(string.Join(", ", names)); -Console.ReadLine(); -// var page = await printer.Value.Print("Test Page", new CancellationToken()); -// var data = page.Value.GetData(); -// Console.WriteLine("Data : {0}", Encoding.UTF8.GetString(data)); -// -// var loadSingleton = context.GetSingleObject(typeof(ILoadTest)) as ILoadTest; -// -// const int iterations = 10000; -// var timer = Stopwatch.StartNew(); -// var x = 0; -// for (int i = 0; i < iterations; i++) -// { -// x = loadSingleton.Next(x); -// } -// -// timer.Stop(); -// Console.WriteLine("X is {0}", x); -// Console.WriteLine("Time : {0}", timer.Elapsed.TotalMilliseconds); \ No newline at end of file +var page = printer.Value.Print("Test Page", new CancellationToken()).GetAwaiter().GetResult(); +var data = page.Value.GetData(); +Console.WriteLine("Data : {0}", Encoding.UTF8.GetString(data)); + +var loadSingleton = context.GetSingleObject(typeof(ILoadTest)) as ILoadTest; + +const int iterations = 10000; +var timer = Stopwatch.StartNew(); +var x = 0; +for (int i = 0; i < iterations; i++) +{ + x = loadSingleton.Next(x); +} + +timer.Stop(); +Console.WriteLine("X is {0}", x); +Console.WriteLine("Time : {0}", timer.Elapsed.TotalMilliseconds); \ No newline at end of file diff --git a/Example.Shared/ILoadTest.cs b/Example.Shared/ILoadTest.cs index 6cec93f..dc4e787 100644 --- a/Example.Shared/ILoadTest.cs +++ b/Example.Shared/ILoadTest.cs @@ -1,5 +1,4 @@ -using mROA.Implementation; -using mROA.Implementation.Attributes; +using mROA.Implementation.Attributes; namespace Example.Shared; diff --git a/Example.Shared/IPage.cs b/Example.Shared/IPage.cs index cd5c2d8..6f39f19 100644 --- a/Example.Shared/IPage.cs +++ b/Example.Shared/IPage.cs @@ -1,4 +1,3 @@ -using mROA.Implementation; using mROA.Implementation.Attributes; namespace Example.Shared; diff --git a/Example.Shared/IPrinterFactory.cs b/Example.Shared/IPrinterFactory.cs index 5800dd2..eb6ee8e 100644 --- a/Example.Shared/IPrinterFactory.cs +++ b/Example.Shared/IPrinterFactory.cs @@ -1,5 +1,3 @@ -using System.Collections.Frozen; -using mROA.Abstract; using mROA.Implementation; using mROA.Implementation.Attributes; diff --git a/mROA.Benchmark/Program.cs b/mROA.Benchmark/Program.cs index 562a3b7..57ab0c3 100644 --- a/mROA.Benchmark/Program.cs +++ b/mROA.Benchmark/Program.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; namespace mROA.Benchmark; diff --git a/mROA/Abstract/ISerialisationModule.cs b/mROA/Abstract/ISerialisationModule.cs index 0e06e21..546d248 100644 --- a/mROA/Abstract/ISerialisationModule.cs +++ b/mROA/Abstract/ISerialisationModule.cs @@ -1,4 +1,3 @@ -using System.Windows.Input; using mROA.Implementation; namespace mROA.Abstract; @@ -24,8 +23,8 @@ public interface IRepresentationModule : IInjectableModule T GetMessage(Guid? requestId = null, MessageType? messageType = null); Task GetRawMessage(Guid? requestId = null, MessageType? messageType = null); - Task PostCallMessageAsync(Guid id, MessageType messageType, T payload); + Task PostCallMessageAsync(Guid id, MessageType messageType, T payload) where T : notnull; Task PostCallMessageAsync(Guid id, MessageType messageType, object payload, Type payloadType); - void PostCallMessage(Guid id, MessageType messageType, T payload); + void PostCallMessage(Guid id, MessageType messageType, T payload) where T : notnull; void PostCallMessage(Guid id, MessageType messageType, object payload, Type payloadType); } \ No newline at end of file diff --git a/mROA/Implementation/CommandExecution/ExceptionCommandExecution.cs b/mROA/Implementation/CommandExecution/ExceptionCommandExecution.cs index 58ef0a4..d5fc222 100644 --- a/mROA/Implementation/CommandExecution/ExceptionCommandExecution.cs +++ b/mROA/Implementation/CommandExecution/ExceptionCommandExecution.cs @@ -1,5 +1,4 @@ -using System.Text.Json; -using mROA.Abstract; +using mROA.Abstract; using mROA.Implementation.Frontend; namespace mROA.Implementation; diff --git a/mROA/Implementation/CreativeSerializationModuleProducer.cs b/mROA/Implementation/CreativeSerializationModuleProducer.cs index f61bd2d..ee63de9 100644 --- a/mROA/Implementation/CreativeSerializationModuleProducer.cs +++ b/mROA/Implementation/CreativeSerializationModuleProducer.cs @@ -1,6 +1,4 @@ using mROA.Abstract; -using mROA.Implementation.Backend; -using mROA.Implementation.Frontend; namespace mROA.Implementation; diff --git a/mROA/Implementation/Frontend/JsonFrontendSerialisationModule.cs b/mROA/Implementation/Frontend/JsonFrontendSerialisationModule.cs index 5ef07e7..dce21a4 100644 --- a/mROA/Implementation/Frontend/JsonFrontendSerialisationModule.cs +++ b/mROA/Implementation/Frontend/JsonFrontendSerialisationModule.cs @@ -1,7 +1,3 @@ -using System.Text; -using System.Text.Json; -using mROA.Abstract; - namespace mROA.Implementation.Frontend; // public class JsonFrontendSerialisationModule diff --git a/mROA/Implementation/Frontend/NetworkFrontendBridge.cs b/mROA/Implementation/Frontend/NetworkFrontendBridge.cs index 7ef68c1..650b42c 100644 --- a/mROA/Implementation/Frontend/NetworkFrontendBridge.cs +++ b/mROA/Implementation/Frontend/NetworkFrontendBridge.cs @@ -1,7 +1,5 @@ using System.Net; using System.Net.Sockets; -using System.Text; -using System.Text.Json; using mROA.Abstract; namespace mROA.Implementation.Frontend; diff --git a/mROA/Implementation/Frontend/StreamBasedFrontendInteractionModule.cs b/mROA/Implementation/Frontend/StreamBasedFrontendInteractionModule.cs index 36fe157..21cbbfe 100644 --- a/mROA/Implementation/Frontend/StreamBasedFrontendInteractionModule.cs +++ b/mROA/Implementation/Frontend/StreamBasedFrontendInteractionModule.cs @@ -1,5 +1,3 @@ -using mROA.Abstract; - namespace mROA.Implementation.Frontend; // public class StreamBasedFrontendInteractionModule : IInteractionModule.IFrontendInteractionModule diff --git a/mROA/Implementation/JsonSerializationToolkit.cs b/mROA/Implementation/JsonSerializationToolkit.cs index 2f12d2a..366e970 100644 --- a/mROA/Implementation/JsonSerializationToolkit.cs +++ b/mROA/Implementation/JsonSerializationToolkit.cs @@ -26,12 +26,12 @@ public class JsonSerializationToolkit : ISerializationToolkit public T Cast(object nonCasted) { - if (nonCasted is JsonElement jsonElement) - return jsonElement.Deserialize()!; - if (nonCasted is T casted) - return casted; - - throw new JsonException("Cannot cast object to type " + typeof(T).FullName); + return nonCasted switch + { + JsonElement jsonElement => jsonElement.Deserialize()!, + T casted => casted, + _ => throw new JsonException("Cannot cast object to type " + typeof(T).FullName) + }; } public object Cast(object nonCasted, Type type) diff --git a/mROA/Implementation/NetworkMessage.cs b/mROA/Implementation/NetworkMessage.cs index 405168d..9ff4c83 100644 --- a/mROA/Implementation/NetworkMessage.cs +++ b/mROA/Implementation/NetworkMessage.cs @@ -1,18 +1,17 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using mROA.Abstract; +using System.Text.Json.Serialization; namespace mROA.Implementation; public class NetworkMessage { - public Guid Id { get; set; } + public Guid Id { get; init; } [JsonConverter(typeof(JsonStringEnumConverter))] - public MessageType SchemaId { get; set; } - public byte[] Data { get; set; } + public MessageType SchemaId { get; init; } + + public required byte[] Data { get; init; } } public enum MessageType { - Unknown, FinishedCommandExecution, ExceptionCommandExecution, AcyncCancelCommandExecution, CallRequest, IdAssigning + Unknown, FinishedCommandExecution, ExceptionCommandExecution, AsyncCancelCommandExecution, CallRequest, IdAssigning } \ No newline at end of file diff --git a/mROA/Implementation/NextGenerationInteractionModule.cs b/mROA/Implementation/NextGenerationInteractionModule.cs index d9f1ce2..911f748 100644 --- a/mROA/Implementation/NextGenerationInteractionModule.cs +++ b/mROA/Implementation/NextGenerationInteractionModule.cs @@ -1,5 +1,4 @@ -using System.Text; -using mROA.Abstract; +using mROA.Abstract; namespace mROA.Implementation; @@ -11,7 +10,7 @@ public class NextGenerationInteractionModule : INextGenerationInteractionModule private Task? _currentReceiving; private const int BufferSize = ushort.MaxValue; private readonly byte[] _buffer = new byte[BufferSize]; - private List _messageBuffer = []; + private readonly List _messageBuffer = []; public void Inject(T dependency) @@ -32,13 +31,10 @@ public class NextGenerationInteractionModule : INextGenerationInteractionModule { // Console.WriteLine(_currentReceiving?.Status); - if (_currentReceiving == null) - { - _currentReceiving = Task.Run(GetNextMessage); - return _currentReceiving; - } - + if (_currentReceiving != null) return _currentReceiving; + _currentReceiving = Task.Run(GetNextMessage); return _currentReceiving; + } public async Task PostMessage(NetworkMessage message) @@ -46,6 +42,9 @@ public class NextGenerationInteractionModule : INextGenerationInteractionModule if (BaseStream == null) throw new NullReferenceException("BaseStream is null"); + if (_serialization == null) + throw new NullReferenceException("Serialization toolkit is not initialized"); + // Console.WriteLine("Sending {0}", JsonSerializer.Serialize(message)); diff --git a/mROA/Implementation/RemoteContextRepository.cs b/mROA/Implementation/RemoteContextRepository.cs index 7ff911a..37eac71 100644 --- a/mROA/Implementation/RemoteContextRepository.cs +++ b/mROA/Implementation/RemoteContextRepository.cs @@ -5,8 +5,8 @@ namespace mROA.Implementation; public class RemoteContextRepository : IContextRepository { - private IRepresentationModuleProducer _representationProducer; - public static FrozenDictionary RemoteTypes; + private IRepresentationModuleProducer? _representationProducer; + public static FrozenDictionary RemoteTypes = FrozenDictionary.Empty; public int ResisterObject(object o) { throw new NotSupportedException(); @@ -24,16 +24,19 @@ public class RemoteContextRepository : IContextRepository public T GetObject(int id) { - if (RemoteTypes.TryGetValue(typeof(T), out var remoteType)) - { - var remote = (T)Activator.CreateInstance(remoteType, id, _representationProducer.Produce(TransmissionConfig.OwnershipRepository!.GetOwnershipId()))!; - return remote; - } - throw new NotSupportedException(); + if (_representationProducer == null) + throw new NullReferenceException("representation producer is not initialized"); + + if (!RemoteTypes.TryGetValue(typeof(T), out var remoteType)) throw new NotSupportedException(); + var remote = (T)Activator.CreateInstance(remoteType, id, _representationProducer.Produce(TransmissionConfig.OwnershipRepository.GetOwnershipId()))!; + return remote; } public object GetSingleObject(Type type) { + if (_representationProducer == null) + throw new NullReferenceException("representation producer is not initialized"); + return Activator.CreateInstance(RemoteTypes[type], -1, _representationProducer.Produce(TransmissionConfig.OwnershipRepository.GetOwnershipId()))!; } diff --git a/mROA/Implementation/RemoteObjectBase.cs b/mROA/Implementation/RemoteObjectBase.cs index fecf8eb..7ffab21 100644 --- a/mROA/Implementation/RemoteObjectBase.cs +++ b/mROA/Implementation/RemoteObjectBase.cs @@ -1,32 +1,25 @@ -using mROA.Implementation; +using mROA.Abstract; + // ReSharper disable UnusedMember.Global -namespace mROA.Abstract; +namespace mROA.Implementation; -public abstract class RemoteObjectBase +public abstract class RemoteObjectBase(int id, IRepresentationModule representationModule) { - private readonly int _id; - private readonly IRepresentationModule _representationModule; - public int Id => _id; - public int OwnerId => _representationModule.Id; + public int Id => id; + public int OwnerId => representationModule.Id; - public RemoteObjectBase(int id, IRepresentationModule representationModule) - { - _id = id; - _representationModule = representationModule; - } - - public async Task GetResultAsync(int methodId, object? parameter = default) + protected async Task GetResultAsync(int methodId, object? parameter = default) { var request = new DefaultCallRequest - { CommandId = methodId, ObjectId = _id, Parameter = parameter, ParameterType = parameter?.GetType() }; - await _representationModule.PostCallMessageAsync(request.Id, MessageType.CallRequest, request); + { CommandId = methodId, ObjectId = id, Parameter = parameter, ParameterType = parameter?.GetType() }; + await representationModule.PostCallMessageAsync(request.Id, MessageType.CallRequest, request); var successResponse = - _representationModule.GetMessageAsync>( + representationModule.GetMessageAsync>( messageType: MessageType.FinishedCommandExecution, requestId: request.Id); var errorResponse = - _representationModule.GetMessageAsync( + representationModule.GetMessageAsync( messageType: MessageType.ExceptionCommandExecution, requestId: request.Id); Task.WaitAny(successResponse, errorResponse); @@ -36,17 +29,17 @@ public abstract class RemoteObjectBase throw errorResponse.Result.GetException(); } - public async Task CallAsync(int methodId, object? parameter = default) + protected async Task CallAsync(int methodId, object? parameter = default) { var request = new DefaultCallRequest - { CommandId = methodId, ObjectId = _id, Parameter = parameter, ParameterType = parameter?.GetType() }; - await _representationModule.PostCallMessageAsync(request.Id, MessageType.CallRequest, request); + { CommandId = methodId, ObjectId = id, Parameter = parameter, ParameterType = parameter?.GetType() }; + await representationModule.PostCallMessageAsync(request.Id, MessageType.CallRequest, request); var successResponse = - _representationModule.GetMessageAsync( + representationModule.GetMessageAsync( messageType: MessageType.FinishedCommandExecution, requestId: request.Id); var errorResponse = - _representationModule.GetMessageAsync( + representationModule.GetMessageAsync( messageType: MessageType.ExceptionCommandExecution, requestId: request.Id); Task.WaitAny(successResponse, errorResponse); diff --git a/mROA/Implementation/RepresentationModule.cs b/mROA/Implementation/RepresentationModule.cs index 094866c..7dda269 100644 --- a/mROA/Implementation/RepresentationModule.cs +++ b/mROA/Implementation/RepresentationModule.cs @@ -1,12 +1,11 @@ -using System.Text.Json; -using mROA.Abstract; +using mROA.Abstract; namespace mROA.Implementation; public class RepresentationModule : IRepresentationModule { - private ISerializationToolkit _serialization; - private INextGenerationInteractionModule _interaction; + private ISerializationToolkit? _serialization; + private INextGenerationInteractionModule? _interaction; public void Inject(T dependency) { @@ -21,20 +20,29 @@ public class RepresentationModule : IRepresentationModule } } - public int Id => _interaction.ConnectionId; + public int Id => (_interaction ?? throw new NullReferenceException("Interaction is not initialized")).ConnectionId; public async Task GetMessageAsync(Guid? requestId, MessageType? messageType) { + if (_serialization == null) + throw new NullReferenceException("Serialization toolkit is not initialized"); + return _serialization.Deserialize(await GetRawMessage(requestId, messageType))!; } public T GetMessage(Guid? requestId = null, MessageType? messageType = null) { + if (_serialization == null) + throw new NullReferenceException("Serialization toolkit is not initialized"); + return _serialization.Deserialize(GetRawMessage(requestId, messageType).GetAwaiter().GetResult())!; } public async Task GetRawMessage(Guid? requestId = null, MessageType? messageType = null) { + if (_interaction == null) + throw new NullReferenceException("Interaction toolkit is not initialized"); + var fromBuffer = _interaction.UnhandledMessages.FirstOrDefault(message => (requestId is null || message.Id == requestId) && @@ -44,12 +52,11 @@ public class RepresentationModule : IRepresentationModule while (true) { var message = await _interaction.GetNextMessageReceiving(); - if ((requestId is null || message.Id == requestId) && - (messageType is null || message.SchemaId == messageType)) - { - _interaction.HandleMessage(message); - return message.Data; - } + if ((requestId is not null && message.Id != requestId) || + (messageType is not null && message.SchemaId != messageType)) continue; + + _interaction.HandleMessage(message); + return message.Data; } } @@ -57,18 +64,23 @@ public class RepresentationModule : IRepresentationModule return fromBuffer.Data; } - public async Task PostCallMessageAsync(Guid id, MessageType messageType, T payload) + public async Task PostCallMessageAsync(Guid id, MessageType messageType, T payload) where T : notnull { await PostCallMessageAsync(id, messageType, payload, typeof(T)); } public async Task PostCallMessageAsync(Guid id, MessageType messageType, object payload, Type payloadType) { + if (_interaction == null) + throw new NullReferenceException("Interaction toolkit is not initialized"); + if (_serialization == null) + throw new NullReferenceException("Serialization toolkit is not initialized"); + await _interaction.PostMessage(new NetworkMessage { Id = id, SchemaId = messageType, Data = _serialization.Serialize(payload, payloadType) }); } - public void PostCallMessage(Guid id, MessageType messageType, T payload) + public void PostCallMessage(Guid id, MessageType messageType, T payload) where T : notnull { PostCallMessageAsync(id, messageType, payload).GetAwaiter().GetResult(); } diff --git a/mROA/Implementation/SharedObject.cs b/mROA/Implementation/SharedObject.cs index a122257..644b8f4 100644 --- a/mROA/Implementation/SharedObject.cs +++ b/mROA/Implementation/SharedObject.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; using mROA.Abstract; +// ReSharper disable UnusedMember.Global +#pragma warning disable CS8618, CS9264 namespace mROA.Implementation; @@ -32,7 +34,7 @@ public static class TransmissionConfig public class SharedObject where T : notnull { private IContextRepository GetDefaultContextRepository() => - (OwnerId == TransmissionConfig.OwnershipRepository!.GetHostOwnershipId() + (OwnerId == TransmissionConfig.OwnershipRepository.GetHostOwnershipId() ? TransmissionConfig.RealContextRepository : TransmissionConfig.RemoteEndpointContextRepository) ?? throw new NullReferenceException( @@ -45,10 +47,10 @@ public class SharedObject where T : notnull { get { - _ownerId = _ownerId == -1 ? TransmissionConfig.OwnershipRepository!.GetOwnershipId() : _ownerId; + _ownerId = _ownerId == -1 ? TransmissionConfig.OwnershipRepository.GetOwnershipId() : _ownerId; return _ownerId; } - set => _ownerId = value; + init => _ownerId = value; } // ReSharper disable once MemberCanBePrivate.Global @@ -60,7 +62,7 @@ public class SharedObject where T : notnull if (_contextId != -2) return _contextId; - _contextId = TransmissionConfig.RealContextRepository!.GetObjectIndex(Value); + _contextId = TransmissionConfig.RealContextRepository.GetObjectIndex(Value); return _contextId; } init @@ -70,9 +72,10 @@ public class SharedObject where T : notnull } } - [JsonIgnore] public T Value { get; private set; } + [JsonIgnore] public T Value { get; private init; } // ReSharper disable once MemberCanBePrivate.Global + // ReSharper disable once UnusedMember.Global public SharedObject() { } @@ -88,7 +91,7 @@ public class SharedObject where T : notnull _contextId = ro.Id; } else - _ownerId = TransmissionConfig.OwnershipRepository!.GetHostOwnershipId(); + _ownerId = TransmissionConfig.OwnershipRepository.GetHostOwnershipId(); } public static implicit operator T(SharedObject value) => value.Value; diff --git a/mROA/Implementation/StaticRepresentationModuleProducer.cs b/mROA/Implementation/StaticRepresentationModuleProducer.cs index ac3ea99..8b0632a 100644 --- a/mROA/Implementation/StaticRepresentationModuleProducer.cs +++ b/mROA/Implementation/StaticRepresentationModuleProducer.cs @@ -4,16 +4,18 @@ namespace mROA.Implementation; public class StaticRepresentationModuleProducer : IRepresentationModuleProducer { - private IRepresentationModule _reprModule; + private IRepresentationModule? _representationModule; public IRepresentationModule Produce(int ownership) { - return _reprModule; + if (_representationModule == null) + throw new NullReferenceException("The representation module is not initialized."); + return _representationModule; } public void Inject(T dependency) { if (dependency is IRepresentationModule serialisationModule) - _reprModule = serialisationModule; + _representationModule = serialisationModule; } } \ No newline at end of file