From 03fc57ee17c699b11515f19da6162165919654e3 Mon Sep 17 00:00:00 2001
From: IX-BOT <137874481+IX-BOT@users.noreply.github.com>
Date: Wed, 27 Dec 2023 10:05:19 +0100
Subject: [PATCH 1/7] Create draft PR for #276
From 72190a71d41ee458e3324503b5cab508ce088275 Mon Sep 17 00:00:00 2001
From: PTKu <61538034+PTKu@users.noreply.github.com>
Date: Wed, 3 Jan 2024 11:36:58 +0100
Subject: [PATCH 2/7] adds methods to check whether online data changed -
comparison is made via Poco objects - when POCO is compiler ignored limits
use for members not present in POCO type
---
.../AXSharp.Abstractions.csproj | 4 -
...XSharp.Presentation.Blazor.Controls.csproj | 11 +-
.../AXSharp.Compiler.Cs.csproj | 6 +-
.../AXSharp.Cs.Compiler/Helpers/CsHelpers.cs | 7 +
.../Onliner/CsOnlinerSourceBuilder.cs | 3 +
.../CsOnlinerHasChangedBuilder.cs | 185 +++++
.../Exploratory/Generics.cs | 5 +
.../.g/Onliners/array_declaration.g.cs | 56 ++
.../.g/Onliners/class_all_primitives.g.cs | 66 ++
.../class_extended_by_known_type.g.cs | 50 ++
.../expected/.g/Onliners/class_extends.g.cs | 46 ++
.../class_extends_and_implements.g.cs | 46 ++
.../.g/Onliners/class_generic_extension.g.cs | 98 +++
.../.g/Onliners/class_implements.g.cs | 22 +
.../Onliners/class_implements_multiple.g.cs | 22 +
.../expected/.g/Onliners/class_internal.g.cs | 22 +
.../.g/Onliners/class_no_access_modifier.g.cs | 22 +
.../Onliners/class_with_complex_members.g.cs | 46 ++
.../class_with_non_public_members.g.cs | 46 ++
.../.g/Onliners/class_with_pragmas.g.cs | 46 ++
.../class_with_primitive_members.g.cs | 76 ++
.../Onliners/class_with_using_directives.g.cs | 22 +
.../.g/Onliners/compileromitsattribute.g.cs | 240 ++++++
.../expected/.g/Onliners/configuration.g.cs | 128 ++++
.../expected/.g/Onliners/makereadonce.g.cs | 56 ++
.../expected/.g/Onliners/makereadonly.g.cs | 56 ++
.../units/expected/.g/Onliners/misc.g.cs | 186 +++++
.../expected/.g/Onliners/mixed_access.g.cs | 194 +++++
.../expected/.g/Onliners/ref_to_simple.g.cs | 46 ++
.../.g/Onliners/simple_empty_class.g.cs | 22 +
.../simple_empty_class_within_namespace.g.cs | 22 +
.../expected/.g/Onliners/struct_simple.g.cs | 50 ++
.../.g/Onliners/type_named_values.g.cs | 24 +
.../Onliners/type_named_values_literals.g.cs | 24 +
.../expected/.g/Onliners/type_with_enum.g.cs | 26 +
.../Onliners/types_with_name_attributes.g.cs | 74 ++
.../types_with_property_attributes.g.cs | 24 +
.../src/AXSharp.Connector/ITwinObject.cs | 7 +
.../src/AXSharp.Connector/RootTwinObject.cs | 5 +
.../AXSharp.Connector/TwinObjectExtensions.cs | 2 +
.../AXSharp.TIA.Connector/TIATwinObject.cs | 5 +
.../WebApiConnectorFactoryTests.cs | 5 +
.../Identity/TwinIdentityProviderTests.cs | 10 +
.../StringInterpolatorTests.cs | 15 +
.../ValueTypes/TestTwinObject.cs | 5 +
.../IPlainExtensionsTests.cs | 5 +
.../TwinObjectExtensionsTests.cs | 5 +
.../tests/ax-test-project/apax-lock.json | 693 ++++++++++++++++++
.../tests/ax-test-project/apax.yml | 10 +-
src/apax/apax.yml | 2 +-
.../integrated/src/ax/apax-lock.json | 693 ++++++++++++++++++
.../integrated/src/ax/apax.yml | 9 +-
.../integrated/src/ax/src/configuration.st | 3 +
.../.g/Onliners/configuration.g.cs | 38 +
.../Onliners/dataswapping/all_primitives.g.cs | 63 ++
.../.g/Onliners/dataswapping/moster.g.cs | 83 +++
.../.g/Onliners/dataswapping/realmonster.g.cs | 166 +++++
.../.g/POCO/configuration.g.cs | 1 +
.../integrated.tests/ChangeDetectionTests.cs | 162 ++++
.../integrated.tests/PlainersSwappingTests.cs | 4 +
60 files changed, 4045 insertions(+), 25 deletions(-)
create mode 100644 src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/HasChangedBuilder/CsOnlinerHasChangedBuilder.cs
create mode 100644 src/AXSharp.connectors/tests/ax-test-project/apax-lock.json
create mode 100644 src/tests.integrations/integrated/src/ax/apax-lock.json
create mode 100644 src/tests.integrations/integrated/tests/integrated.tests/ChangeDetectionTests.cs
diff --git a/src/AXSharp.abstractions/src/AXSharp.Abstractions/AXSharp.Abstractions.csproj b/src/AXSharp.abstractions/src/AXSharp.Abstractions/AXSharp.Abstractions.csproj
index 0b2d7f2e..33f54dd2 100644
--- a/src/AXSharp.abstractions/src/AXSharp.Abstractions/AXSharp.Abstractions.csproj
+++ b/src/AXSharp.abstractions/src/AXSharp.Abstractions/AXSharp.Abstractions.csproj
@@ -42,10 +42,6 @@
-
-
-
-
Full
diff --git a/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/AXSharp.Presentation.Blazor.Controls.csproj b/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/AXSharp.Presentation.Blazor.Controls.csproj
index 4df77933..33cd2ba7 100644
--- a/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/AXSharp.Presentation.Blazor.Controls.csproj
+++ b/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/AXSharp.Presentation.Blazor.Controls.csproj
@@ -82,17 +82,16 @@
-
-
-
-
-
+
-
+
+
+
+
diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/AXSharp.Compiler.Cs.csproj b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/AXSharp.Compiler.Cs.csproj
index 0b366c4b..69ae54bd 100644
--- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/AXSharp.Compiler.Cs.csproj
+++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/AXSharp.Compiler.Cs.csproj
@@ -58,9 +58,9 @@
-
-
-
+
+
+
diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/CsHelpers.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/CsHelpers.cs
index c56f1b6a..b28476c6 100644
--- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/CsHelpers.cs
+++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/CsHelpers.cs
@@ -7,6 +7,7 @@
using AX.ST.Semantic.Model.Declarations;
using AX.ST.Syntax.Tree;
+using AXSharp.Connector;
namespace AXSharp.Compiler.Cs.Helpers;
@@ -43,6 +44,12 @@ public static string CreateGenericSwapperMethodToPlainer(string methodName, stri
return $"public async {qualifier} Task {methodName}(){{\n return await (dynamic)this.{methodName}Async();\n}}";
}
+ public static string CreateGenericHasChangedMethodMethod(string methodName, string pocoTypeName, bool isExtended = false)
+ {
+ var qualifier = isExtended ? "override" : "virtual";
+ return $"///\npublic async {qualifier} Task {TwinObjectExtensions.HasChangedMethodName}(T plain){{\n return await this.{methodName}((dynamic)plain);\n}}";
+ }
+
public static string CreateGenericSwapperMethodFromPlainer(string methodName, string pocoTypeName, bool isExtended)
{
var qualifier = isExtended ? "override" : "virtual";
diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs
index 9c410d0b..ef00a14c 100644
--- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs
+++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs
@@ -142,6 +142,8 @@ public void CreateClassDeclaration(IClassDeclarationSyntax classDeclarationSynta
AddToSource(CsOnlinerPlainerShadowToPlainBuilder.Create(visitor, classDeclaration, this, isExtended).Output);
AddToSource(CsOnlinerPlainerShadowToPlainProtectedBuilder.Create(visitor, classDeclaration, this, isExtended).Output);
AddToSource(CsOnlinerPlainerPlainToShadowBuilder.Create(visitor, classDeclaration, this, isExtended).Output);
+
+ AddToSource(CsOnlinerHasChangedBuilder.Create(visitor, classDeclaration, this, isExtended).Output);
AddPollingMethod(isExtended);
AddCreatePocoMethod(classDeclaration, isExtended);
@@ -296,6 +298,7 @@ public void CreateStructuredType(IStructTypeDeclarationSyntax structTypeDeclarat
AddToSource(CsOnlinerPlainerShadowToPlainProtectedBuilder.Create(visitor, structuredTypeDeclaration, this).Output);
AddToSource(CsOnlinerPlainerPlainToShadowBuilder.Create(visitor, structuredTypeDeclaration, this).Output);
+ AddToSource(CsOnlinerHasChangedBuilder.Create(visitor, structuredTypeDeclaration, this).Output);
AddPollingMethod(false);
AddCreatePocoMethod(structuredTypeDeclaration, false);
diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/HasChangedBuilder/CsOnlinerHasChangedBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/HasChangedBuilder/CsOnlinerHasChangedBuilder.cs
new file mode 100644
index 00000000..e7c4d598
--- /dev/null
+++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/HasChangedBuilder/CsOnlinerHasChangedBuilder.cs
@@ -0,0 +1,185 @@
+// AXSharp.Compiler.Cs
+// Copyright (c) 2023 Peter Kurhajec (PTKu), MTS, and Contributors. All Rights Reserved.
+// Contributors: https://github.com/ix-ax/axsharp/graphs/contributors
+// See the LICENSE file in the repository root for more information.
+// https://github.com/ix-ax/axsharp/blob/dev/LICENSE
+// Third party licenses: https://github.com/ix-ax/axsharp/blob/master/notices.md
+
+using AX.ST.Semantic;
+using AX.ST.Semantic.Model.Declarations;
+using AX.ST.Semantic.Model.Declarations.Types;
+using AXSharp.Compiler.Core;
+using AXSharp.Compiler.Cs.Helpers;
+using AXSharp.Connector;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AXSharp.Compiler.Cs.Onliner
+{
+ internal class CsOnlinerHasChangedBuilder : ICombinedThreeVisitor
+ {
+ private readonly StringBuilder _memberDeclarations = new();
+
+ protected CsOnlinerHasChangedBuilder(ISourceBuilder sourceBuilder)
+ {
+ SourceBuilder = sourceBuilder;
+ }
+
+ private ISourceBuilder SourceBuilder { get; }
+
+ public string Output => _memberDeclarations.ToString().FormatCode();
+
+
+ public void CreateFieldDeclaration(IFieldDeclaration fieldDeclaration, IxNodeVisitor visitor)
+ {
+ if (fieldDeclaration.IsMemberEligibleForTranspile(SourceBuilder, "POCO"))
+ {
+ CreateAssignment(fieldDeclaration.Type, fieldDeclaration);
+ }
+ }
+
+ public void CreateInterfaceDeclaration(IInterfaceDeclaration interfaceDeclaration, IxNodeVisitor visitor)
+ {
+ //
+ }
+
+ public void CreateVariableDeclaration(IVariableDeclaration variableDeclaration, IxNodeVisitor visitor)
+ {
+ if (variableDeclaration.IsMemberEligibleForTranspile(SourceBuilder, "POCO"))
+ {
+ CreateAssignment(variableDeclaration.Type, variableDeclaration);
+ }
+ }
+
+ internal void CreateAssignment(ITypeDeclaration typeDeclaration, IDeclaration declaration)
+ {
+ var index_var_name = "i760901_3001_mimi";
+ switch (typeDeclaration)
+ {
+ case IInterfaceDeclaration interfaceDeclaration:
+ break;
+ case IClassDeclaration classDeclaration:
+ //case IAnonymousTypeDeclaration anonymousTypeDeclaration:
+ case IStructuredTypeDeclaration structuredTypeDeclaration:
+ AddToSource($" if(await {declaration.Name}.{MethodName}(plain.{declaration.Name}, latest.{declaration.Name})) somethingChanged = true;");
+ break;
+ case IArrayTypeDeclaration arrayTypeDeclaration:
+ if (arrayTypeDeclaration.IsMemberEligibleForConstructor(SourceBuilder))
+ {
+ switch (arrayTypeDeclaration.ElementTypeAccess.Type)
+ {
+ case IClassDeclaration classDeclaration:
+ case IStructuredTypeDeclaration structuredTypeDeclaration:
+ AddToSource(
+ $"for (int {index_var_name} = 0; {index_var_name} < latest.{declaration.Name}.Length; {index_var_name}++)\r\n{{\r\n if (await {declaration.Name}.ElementAt({index_var_name}).DetectsAnyChangeAsync(plain.{declaration.Name}[{index_var_name}], latest.{declaration.Name}[{index_var_name}]))\r\n somethingChanged = true;\r\n}}");
+ break;
+ case IScalarTypeDeclaration scalarTypeDeclaration:
+ case IStringTypeDeclaration stringTypeDeclaration:
+ AddToSource(
+ $"for (int {index_var_name} = 0; {index_var_name} < latest.{declaration.Name}.Length; {index_var_name}++)\r\n{{\r\n if (latest.{declaration.Name}.ElementAt({index_var_name}) != plain.{declaration.Name}[{index_var_name}])\r\n somethingChanged = true;\r\n}}");
+ break;
+ }
+ }
+
+ break;
+ case IReferenceTypeDeclaration referenceTypeDeclaration:
+ break;
+ case IEnumTypeDeclaration enumTypeDeclaration:
+ AddToSource($" if(plain.{declaration.Name} != ({declaration.Type.FullyQualifiedName})latest.{declaration.Name}) somethingChanged = true;");
+ break;
+ case INamedValueTypeDeclaration namedValueTypeDeclaration:
+ AddToSource($" if(plain.{declaration.Name} != {declaration.Name}.LastValue) somethingChanged = true;");
+ break;
+ case IScalarTypeDeclaration scalarTypeDeclaration:
+ case IStringTypeDeclaration stringTypeDeclaration:
+ AddToSource($" if(plain.{declaration.Name} != {declaration.Name}.LastValue) somethingChanged = true;");
+ break;
+ }
+ }
+
+ public void CreateArrayTypeDeclaration(IArrayTypeDeclaration arrayTypeDeclaration, IxNodeVisitor visitor)
+ {
+ //
+ }
+
+
+ protected void AddToSource(string token, string separator = " ")
+ {
+ _memberDeclarations.Append($"{token}{separator}");
+ }
+
+ public void AddTypeConstructionParameters(string parametersString)
+ {
+ AddToSource(parametersString);
+ }
+
+ protected static readonly string MethodName = $"Detects{TwinObjectExtensions.HasChangedMethodName}";
+
+ public static CsOnlinerHasChangedBuilder Create(IxNodeVisitor visitor, IStructuredTypeDeclaration semantics,
+ ISourceBuilder sourceBuilder)
+ {
+ var builder = new CsOnlinerHasChangedBuilder(sourceBuilder);
+
+ builder.AddToSource(CsHelpers.CreateGenericHasChangedMethodMethod(MethodName, $"Pocos.{semantics.FullyQualifiedName}"));
+
+ builder.AddToSource("///\n");
+ builder.AddToSource("///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.\n");
+ builder.AddToSource("///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.\n");
+ builder.AddToSource("///\n");
+
+
+ builder.AddToSource($"public async Task {MethodName}(Pocos.{semantics.FullyQualifiedName} plain, Pocos.{semantics.FullyQualifiedName} latest = null){{\n");
+ builder.AddToSource("var somethingChanged = false;");
+ builder.AddToSource("if(latest == null) latest = await this._OnlineToPlainNoacAsync();");
+ builder.AddToSource("return await Task.Run(async () => {\n");
+ semantics.Fields.ToList().ForEach(p => p.Accept(visitor, builder));
+ builder.AddToSource($"plain = latest;");
+ builder.AddToSource($"return somethingChanged;");
+ builder.AddToSource($"}});");
+ builder.AddToSource($"}}");
+ return builder;
+ }
+
+ public static CsOnlinerHasChangedBuilder Create(IxNodeVisitor visitor, IClassDeclaration semantics,
+ ISourceBuilder sourceBuilder, bool isExtended)
+ {
+ var builder = new CsOnlinerHasChangedBuilder(sourceBuilder);
+
+ builder.AddToSource(CsHelpers.CreateGenericHasChangedMethodMethod(MethodName, $"Pocos.{semantics.FullyQualifiedName}", isExtended));
+
+ var qualifier = isExtended ? "new" : string.Empty;
+
+ builder.AddToSource("///\n");
+ builder.AddToSource("///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.\n");
+ builder.AddToSource("///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.\n");
+ builder.AddToSource("///\n");
+ builder.AddToSource($"public {qualifier} async Task {MethodName}(Pocos.{semantics.FullyQualifiedName} plain, Pocos.{semantics.FullyQualifiedName} latest = null){{\n");
+
+ builder.AddToSource("if(latest == null) latest = await this._OnlineToPlainNoacAsync();");
+ builder.AddToSource("var somethingChanged = false;");
+
+ builder.AddToSource("return await Task.Run(async () => {\n");
+ if (isExtended)
+ {
+ builder.AddToSource($"if(await base.{MethodName}(plain)) return true;");
+ }
+
+ semantics.Fields.ToList().ForEach(p => p.Accept(visitor, builder));
+
+ builder.AddToSource($"plain = latest;");
+ builder.AddToSource($"return somethingChanged;");
+ builder.AddToSource($"}});");
+ builder.AddToSource($"}}");
+ return builder;
+ }
+
+ ///
+ public void CreateDocComment(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
+ {
+ AddToSource(semanticTypeAccess.AddDocumentationComment(SourceBuilder));
+ }
+ }
+}
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Exploratory/Generics.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Exploratory/Generics.cs
index e801c79f..34032ccc 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Exploratory/Generics.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Exploratory/Generics.cs
@@ -121,6 +121,11 @@ public Task PlainToShadow(T plain)
{
throw new NotImplementedException();
}
+
+ public Task AnyChangeAsync(T plain)
+ {
+ throw new NotImplementedException();
+ }
}
public class GenericMemberB : IPlain
{
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/array_declaration.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/array_declaration.g.cs
index b98f0190..5deb0d23 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/array_declaration.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/array_declaration.g.cs
@@ -136,6 +136,40 @@ public async Task> PlainToShadowAsync(Pocos.ArrayDec
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ArrayDeclarationSimpleNamespace.array_declaration_class plain, Pocos.ArrayDeclarationSimpleNamespace.array_declaration_class latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ for (int i760901_3001_mimi = 0; i760901_3001_mimi < latest.primitive.Length; i760901_3001_mimi++)
+ {
+ if (latest.primitive.ElementAt(i760901_3001_mimi) != plain.primitive[i760901_3001_mimi])
+ somethingChanged = true;
+ }
+
+ for (int i760901_3001_mimi = 0; i760901_3001_mimi < latest.complex.Length; i760901_3001_mimi++)
+ {
+ if (await complex.ElementAt(i760901_3001_mimi).DetectsAnyChangeAsync(plain.complex[i760901_3001_mimi], latest.complex[i760901_3001_mimi]))
+ somethingChanged = true;
+ }
+
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -307,6 +341,28 @@ public async Task> PlainToShadowAsync(Pocos.ArrayDec
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ArrayDeclarationSimpleNamespace.some_complex_type plain, Pocos.ArrayDeclarationSimpleNamespace.some_complex_type latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_all_primitives.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_all_primitives.g.cs
index bdc1f869..2c0a63a0 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_all_primitives.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_all_primitives.g.cs
@@ -420,6 +420,72 @@ public async Task> PlainToShadowAsync(Pocos.class_al
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.class_all_primitives plain, Pocos.class_all_primitives latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.myBOOL != myBOOL.LastValue)
+ somethingChanged = true;
+ if (plain.myBYTE != myBYTE.LastValue)
+ somethingChanged = true;
+ if (plain.myWORD != myWORD.LastValue)
+ somethingChanged = true;
+ if (plain.myDWORD != myDWORD.LastValue)
+ somethingChanged = true;
+ if (plain.myLWORD != myLWORD.LastValue)
+ somethingChanged = true;
+ if (plain.mySINT != mySINT.LastValue)
+ somethingChanged = true;
+ if (plain.myINT != myINT.LastValue)
+ somethingChanged = true;
+ if (plain.myDINT != myDINT.LastValue)
+ somethingChanged = true;
+ if (plain.myLINT != myLINT.LastValue)
+ somethingChanged = true;
+ if (plain.myUSINT != myUSINT.LastValue)
+ somethingChanged = true;
+ if (plain.myUINT != myUINT.LastValue)
+ somethingChanged = true;
+ if (plain.myUDINT != myUDINT.LastValue)
+ somethingChanged = true;
+ if (plain.myULINT != myULINT.LastValue)
+ somethingChanged = true;
+ if (plain.myREAL != myREAL.LastValue)
+ somethingChanged = true;
+ if (plain.myLREAL != myLREAL.LastValue)
+ somethingChanged = true;
+ if (plain.myTIME != myTIME.LastValue)
+ somethingChanged = true;
+ if (plain.myLTIME != myLTIME.LastValue)
+ somethingChanged = true;
+ if (plain.myDATE != myDATE.LastValue)
+ somethingChanged = true;
+ if (plain.myTIME_OF_DAY != myTIME_OF_DAY.LastValue)
+ somethingChanged = true;
+ if (plain.myDATE_AND_TIME != myDATE_AND_TIME.LastValue)
+ somethingChanged = true;
+ if (plain.mySTRING != mySTRING.LastValue)
+ somethingChanged = true;
+ if (plain.myWSTRING != myWSTRING.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extended_by_known_type.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extended_by_known_type.g.cs
index 343f2055..e296c211 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extended_by_known_type.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extended_by_known_type.g.cs
@@ -100,6 +100,30 @@ public async Task> PlainToShadowAsync(Pocos.Simatic.
return this.RetrievePrimitives();
}
+ ///
+ public async override Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public new async Task DetectsAnyChangeAsync(Pocos.Simatic.Ax.StateFramework.State1Transition plain, Pocos.Simatic.Ax.StateFramework.State1Transition latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await base.DetectsAnyChangeAsync(plain))
+ return true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public new void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -230,6 +254,32 @@ public async Task> PlainToShadowAsync(Pocos.Simatic.
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.Simatic.Ax.StateFramework.AbstractState plain, Pocos.Simatic.Ax.StateFramework.AbstractState latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.StateID != StateID.LastValue)
+ somethingChanged = true;
+ if (plain.StateName != StateName.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extends.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extends.g.cs
index 9b17569f..44483170 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extends.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extends.g.cs
@@ -98,6 +98,30 @@ public async Task> PlainToShadowAsync(Pocos.Extended
return this.RetrievePrimitives();
}
+ ///
+ public async override Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public new async Task DetectsAnyChangeAsync(Pocos.Extended plain, Pocos.Extended latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await base.DetectsAnyChangeAsync(plain))
+ return true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public new void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -195,6 +219,28 @@ public async Task> PlainToShadowAsync(Pocos.Extendee
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.Extendee plain, Pocos.Extendee latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extends_and_implements.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extends_and_implements.g.cs
index 2d0c278e..7a0a86ad 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extends_and_implements.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extends_and_implements.g.cs
@@ -98,6 +98,30 @@ public async Task> PlainToShadowAsync(Pocos.ExtendsA
return this.RetrievePrimitives();
}
+ ///
+ public async override Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public new async Task DetectsAnyChangeAsync(Pocos.ExtendsAndImplements plain, Pocos.ExtendsAndImplements latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await base.DetectsAnyChangeAsync(plain))
+ return true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public new void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -195,6 +219,28 @@ public async Task> PlainToShadowAsync(Pocos.Extendee
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ExtendeeExtendsAndImplements plain, Pocos.ExtendeeExtendsAndImplements latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_generic_extension.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_generic_extension.g.cs
index b7049813..2b3483f6 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_generic_extension.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_generic_extension.g.cs
@@ -92,6 +92,28 @@ public async Task> PlainToShadowAsync(Pocos.Generics
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.Generics.Extender plain, Pocos.Generics.Extender latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -313,6 +335,34 @@ public async Task> PlainToShadowAsync(Pocos.Generics
return this.RetrievePrimitives();
}
+ ///
+ public async override Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public new async Task DetectsAnyChangeAsync(Pocos.Generics.Extendee plain, Pocos.Generics.Extendee latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await base.DetectsAnyChangeAsync(plain))
+ return true;
+ if (await SomeType.DetectsAnyChangeAsync(plain.SomeType, latest.SomeType))
+ somethingChanged = true;
+ if (await SomeTypeAsPoco.DetectsAnyChangeAsync(plain.SomeTypeAsPoco, latest.SomeTypeAsPoco))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public new void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -439,6 +489,32 @@ public async Task> PlainToShadowAsync(Pocos.Generics
return this.RetrievePrimitives();
}
+ ///
+ public async override Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public new async Task DetectsAnyChangeAsync(Pocos.Generics.Extendee2 plain, Pocos.Generics.Extendee2 latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await base.DetectsAnyChangeAsync(plain))
+ return true;
+ if (await SomeType.DetectsAnyChangeAsync(plain.SomeType, latest.SomeType))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public new void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -536,6 +612,28 @@ public async Task> PlainToShadowAsync(Pocos.Generics
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.Generics.SomeType plain, Pocos.Generics.SomeType latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_implements.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_implements.g.cs
index 721fa867..fc71424d 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_implements.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_implements.g.cs
@@ -90,6 +90,28 @@ public async Task> PlainToShadowAsync(Pocos._NULL_CO
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos._NULL_CONTEXT plain, Pocos._NULL_CONTEXT latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_implements_multiple.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_implements_multiple.g.cs
index 89d59e20..57207585 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_implements_multiple.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_implements_multiple.g.cs
@@ -90,6 +90,28 @@ public async Task> PlainToShadowAsync(Pocos._NULL_CO
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos._NULL_CONTEXT_MULTIPLE plain, Pocos._NULL_CONTEXT_MULTIPLE latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_internal.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_internal.g.cs
index 980e3a1a..0929a8fb 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_internal.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_internal.g.cs
@@ -90,6 +90,28 @@ public async Task> PlainToShadowAsync(Pocos.ClassWit
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ClassWithComplexTypes plain, Pocos.ClassWithComplexTypes latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_no_access_modifier.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_no_access_modifier.g.cs
index faa965b0..af6e8a75 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_no_access_modifier.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_no_access_modifier.g.cs
@@ -90,6 +90,28 @@ public async Task> PlainToShadowAsync(Pocos.NoAccess
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.NoAccessModifierClass plain, Pocos.NoAccessModifierClass latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_complex_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_complex_members.g.cs
index 9e94144c..65ed1ceb 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_complex_members.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_complex_members.g.cs
@@ -113,6 +113,30 @@ public async Task> PlainToShadowAsync(Pocos.ClassWit
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ClassWithComplexTypesNamespace.ClassWithComplexTypes plain, Pocos.ClassWithComplexTypesNamespace.ClassWithComplexTypes latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await myComplexType.DetectsAnyChangeAsync(plain.myComplexType, latest.myComplexType))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -284,6 +308,28 @@ public async Task> PlainToShadowAsync(Pocos.ClassWit
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ClassWithComplexTypesNamespace.ComplexType1 plain, Pocos.ClassWithComplexTypesNamespace.ComplexType1 latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_non_public_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_non_public_members.g.cs
index d45ea598..58646006 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_non_public_members.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_non_public_members.g.cs
@@ -113,6 +113,30 @@ public async Task> PlainToShadowAsync(Pocos.ClassWit
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ClassWithNonTraspilableMemberssNamespace.ClassWithNonTraspilableMembers plain, Pocos.ClassWithNonTraspilableMemberssNamespace.ClassWithNonTraspilableMembers latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await myComplexType.DetectsAnyChangeAsync(plain.myComplexType, latest.myComplexType))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -284,6 +308,28 @@ public async Task> PlainToShadowAsync(Pocos.ClassWit
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ClassWithNonTraspilableMemberssNamespace.ComplexType1 plain, Pocos.ClassWithNonTraspilableMemberssNamespace.ComplexType1 latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_pragmas.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_pragmas.g.cs
index 8ca94821..719a472a 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_pragmas.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_pragmas.g.cs
@@ -115,6 +115,30 @@ public async Task> PlainToShadowAsync(Pocos.ClassWit
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ClassWithPragmasNamespace.ClassWithPragmas plain, Pocos.ClassWithPragmasNamespace.ClassWithPragmas latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await myComplexType.DetectsAnyChangeAsync(plain.myComplexType, latest.myComplexType))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -286,6 +310,28 @@ public async Task> PlainToShadowAsync(Pocos.ClassWit
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ClassWithPragmasNamespace.ComplexType1 plain, Pocos.ClassWithPragmasNamespace.ComplexType1 latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_primitive_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_primitive_members.g.cs
index 657546b8..d80acd05 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_primitive_members.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_primitive_members.g.cs
@@ -497,6 +497,82 @@ public async Task> PlainToShadowAsync(Pocos.ClassWit
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ClassWithPrimitiveTypesNamespace.ClassWithPrimitiveTypes plain, Pocos.ClassWithPrimitiveTypesNamespace.ClassWithPrimitiveTypes latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.myBOOL != myBOOL.LastValue)
+ somethingChanged = true;
+ if (plain.myBYTE != myBYTE.LastValue)
+ somethingChanged = true;
+ if (plain.myWORD != myWORD.LastValue)
+ somethingChanged = true;
+ if (plain.myDWORD != myDWORD.LastValue)
+ somethingChanged = true;
+ if (plain.myLWORD != myLWORD.LastValue)
+ somethingChanged = true;
+ if (plain.mySINT != mySINT.LastValue)
+ somethingChanged = true;
+ if (plain.myINT != myINT.LastValue)
+ somethingChanged = true;
+ if (plain.myDINT != myDINT.LastValue)
+ somethingChanged = true;
+ if (plain.myLINT != myLINT.LastValue)
+ somethingChanged = true;
+ if (plain.myUSINT != myUSINT.LastValue)
+ somethingChanged = true;
+ if (plain.myUINT != myUINT.LastValue)
+ somethingChanged = true;
+ if (plain.myUDINT != myUDINT.LastValue)
+ somethingChanged = true;
+ if (plain.myULINT != myULINT.LastValue)
+ somethingChanged = true;
+ if (plain.myREAL != myREAL.LastValue)
+ somethingChanged = true;
+ if (plain.myLREAL != myLREAL.LastValue)
+ somethingChanged = true;
+ if (plain.myTIME != myTIME.LastValue)
+ somethingChanged = true;
+ if (plain.myLTIME != myLTIME.LastValue)
+ somethingChanged = true;
+ if (plain.myDATE != myDATE.LastValue)
+ somethingChanged = true;
+ if (plain.myLDATE != myLDATE.LastValue)
+ somethingChanged = true;
+ if (plain.myTIME_OF_DAY != myTIME_OF_DAY.LastValue)
+ somethingChanged = true;
+ if (plain.myLTIME_OF_DAY != myLTIME_OF_DAY.LastValue)
+ somethingChanged = true;
+ if (plain.myDATE_AND_TIME != myDATE_AND_TIME.LastValue)
+ somethingChanged = true;
+ if (plain.myLDATE_AND_TIME != myLDATE_AND_TIME.LastValue)
+ somethingChanged = true;
+ if (plain.myCHAR != myCHAR.LastValue)
+ somethingChanged = true;
+ if (plain.myWCHAR != myWCHAR.LastValue)
+ somethingChanged = true;
+ if (plain.mySTRING != mySTRING.LastValue)
+ somethingChanged = true;
+ if (plain.myWSTRING != myWSTRING.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_using_directives.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_using_directives.g.cs
index 16e82b7d..7aaf679d 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_using_directives.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_using_directives.g.cs
@@ -93,6 +93,28 @@ public async Task> PlainToShadowAsync(Pocos.ClassWit
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ClassWithUsingDirectives plain, Pocos.ClassWithUsingDirectives latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/compileromitsattribute.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/compileromitsattribute.g.cs
index 22d52e9d..75699b34 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/compileromitsattribute.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/compileromitsattribute.g.cs
@@ -115,6 +115,34 @@ public async Task> PlainToShadowAsync(Pocos.Compiler
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.CompilerOmmits.ClassWithArrays plain, Pocos.CompilerOmmits.ClassWithArrays latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ for (int i760901_3001_mimi = 0; i760901_3001_mimi < latest._primitive.Length; i760901_3001_mimi++)
+ {
+ if (latest._primitive.ElementAt(i760901_3001_mimi) != plain._primitive[i760901_3001_mimi])
+ somethingChanged = true;
+ }
+
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -316,6 +344,32 @@ public async Task> PlainToShadowAsync(Pocos.Compiler
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.CompilerOmmits.Complex plain, Pocos.CompilerOmmits.Complex latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.HelloString != HelloString.LastValue)
+ somethingChanged = true;
+ if (plain.Id != Id.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -522,6 +576,32 @@ public async Task> PlainToShadowAsync(Pocos.Enums.Cl
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.Enums.ClassWithEnums plain, Pocos.Enums.ClassWithEnums latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.colors != (Enums.Colors)latest.colors)
+ somethingChanged = true;
+ if (plain.NamedValuesColors != NamedValuesColors.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -752,6 +832,32 @@ public async Task> PlainToShadowAsync(Pocos.misc.Var
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.misc.VariousMembers plain, Pocos.misc.VariousMembers latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await _SomeClass.DetectsAnyChangeAsync(plain._SomeClass, latest._SomeClass))
+ somethingChanged = true;
+ if (await _Motor.DetectsAnyChangeAsync(plain._Motor, latest._Motor))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -938,6 +1044,30 @@ public async Task> PlainToShadowAsync(Pocos.misc.Som
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.misc.SomeClass plain, Pocos.misc.SomeClass latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.SomeClassVariable != SomeClassVariable.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -1118,6 +1248,30 @@ public async Task> PlainToShadowAsync(Pocos.misc.Mot
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.misc.Motor plain, Pocos.misc.Motor latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (plain.isRunning != isRunning.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -1319,6 +1473,32 @@ public async Task> PlainToShadowAsync(Pocos.misc.Veh
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.misc.Vehicle plain, Pocos.misc.Vehicle latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (await m.DetectsAnyChangeAsync(plain.m, latest.m))
+ somethingChanged = true;
+ if (plain.displacement != displacement.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -1537,6 +1717,40 @@ public async Task> PlainToShadowAsync(Pocos.UnknownA
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.UnknownArraysShouldNotBeTraspiled.ClassWithArrays plain, Pocos.UnknownArraysShouldNotBeTraspiled.ClassWithArrays latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ for (int i760901_3001_mimi = 0; i760901_3001_mimi < latest._complexKnown.Length; i760901_3001_mimi++)
+ {
+ if (await _complexKnown.ElementAt(i760901_3001_mimi).DetectsAnyChangeAsync(plain._complexKnown[i760901_3001_mimi], latest._complexKnown[i760901_3001_mimi]))
+ somethingChanged = true;
+ }
+
+ for (int i760901_3001_mimi = 0; i760901_3001_mimi < latest._primitive.Length; i760901_3001_mimi++)
+ {
+ if (latest._primitive.ElementAt(i760901_3001_mimi) != plain._primitive[i760901_3001_mimi])
+ somethingChanged = true;
+ }
+
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -1738,6 +1952,32 @@ public async Task> PlainToShadowAsync(Pocos.UnknownA
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.UnknownArraysShouldNotBeTraspiled.Complex plain, Pocos.UnknownArraysShouldNotBeTraspiled.Complex latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.HelloString != HelloString.LastValue)
+ somethingChanged = true;
+ if (plain.Id != Id.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/configuration.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/configuration.g.cs
index 01065f59..b3d301d6 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/configuration.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/configuration.g.cs
@@ -686,6 +686,84 @@ public async Task> PlainToShadowAsync(Pocos.ComplexF
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.ComplexForConfig plain, Pocos.ComplexForConfig latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.myBOOL != myBOOL.LastValue)
+ somethingChanged = true;
+ if (plain.myBYTE != myBYTE.LastValue)
+ somethingChanged = true;
+ if (plain.myWORD != myWORD.LastValue)
+ somethingChanged = true;
+ if (plain.myDWORD != myDWORD.LastValue)
+ somethingChanged = true;
+ if (plain.myLWORD != myLWORD.LastValue)
+ somethingChanged = true;
+ if (plain.mySINT != mySINT.LastValue)
+ somethingChanged = true;
+ if (plain.myINT != myINT.LastValue)
+ somethingChanged = true;
+ if (plain.myDINT != myDINT.LastValue)
+ somethingChanged = true;
+ if (plain.myLINT != myLINT.LastValue)
+ somethingChanged = true;
+ if (plain.myUSINT != myUSINT.LastValue)
+ somethingChanged = true;
+ if (plain.myUINT != myUINT.LastValue)
+ somethingChanged = true;
+ if (plain.myUDINT != myUDINT.LastValue)
+ somethingChanged = true;
+ if (plain.myULINT != myULINT.LastValue)
+ somethingChanged = true;
+ if (plain.myREAL != myREAL.LastValue)
+ somethingChanged = true;
+ if (plain.myLREAL != myLREAL.LastValue)
+ somethingChanged = true;
+ if (plain.myTIME != myTIME.LastValue)
+ somethingChanged = true;
+ if (plain.myLTIME != myLTIME.LastValue)
+ somethingChanged = true;
+ if (plain.myDATE != myDATE.LastValue)
+ somethingChanged = true;
+ if (plain.myLDATE != myLDATE.LastValue)
+ somethingChanged = true;
+ if (plain.myTIME_OF_DAY != myTIME_OF_DAY.LastValue)
+ somethingChanged = true;
+ if (plain.myLTIME_OF_DAY != myLTIME_OF_DAY.LastValue)
+ somethingChanged = true;
+ if (plain.myDATE_AND_TIME != myDATE_AND_TIME.LastValue)
+ somethingChanged = true;
+ if (plain.myLDATE_AND_TIME != myLDATE_AND_TIME.LastValue)
+ somethingChanged = true;
+ if (plain.myCHAR != myCHAR.LastValue)
+ somethingChanged = true;
+ if (plain.myWCHAR != myWCHAR.LastValue)
+ somethingChanged = true;
+ if (plain.mySTRING != mySTRING.LastValue)
+ somethingChanged = true;
+ if (plain.myWSTRING != myWSTRING.LastValue)
+ somethingChanged = true;
+ if (await myMotor.DetectsAnyChangeAsync(plain.myMotor, latest.myMotor))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -880,6 +958,30 @@ public async Task> PlainToShadowAsync(Pocos.Motor pl
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.Motor plain, Pocos.Motor latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (plain.isRunning != isRunning.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -1081,6 +1183,32 @@ public async Task> PlainToShadowAsync(Pocos.Vehicle
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.Vehicle plain, Pocos.Vehicle latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (await m.DetectsAnyChangeAsync(plain.m, latest.m))
+ somethingChanged = true;
+ if (plain.displacement != displacement.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/makereadonce.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/makereadonce.g.cs
index 35cfb553..253e5ae6 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/makereadonce.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/makereadonce.g.cs
@@ -168,6 +168,36 @@ public async Task> PlainToShadowAsync(Pocos.makeread
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.makereadonce.MembersWithMakeReadOnce plain, Pocos.makereadonce.MembersWithMakeReadOnce latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.makeReadOnceMember != makeReadOnceMember.LastValue)
+ somethingChanged = true;
+ if (plain.someOtherMember != someOtherMember.LastValue)
+ somethingChanged = true;
+ if (await makeReadComplexMember.DetectsAnyChangeAsync(plain.makeReadComplexMember, latest.makeReadComplexMember))
+ somethingChanged = true;
+ if (await someotherComplexMember.DetectsAnyChangeAsync(plain.someotherComplexMember, latest.someotherComplexMember))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -369,6 +399,32 @@ public async Task> PlainToShadowAsync(Pocos.makeread
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.makereadonce.ComplexMember plain, Pocos.makereadonce.ComplexMember latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.someMember != someMember.LastValue)
+ somethingChanged = true;
+ if (plain.someOtherMember != someOtherMember.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/makereadonly.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/makereadonly.g.cs
index c863790e..e055e04e 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/makereadonly.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/makereadonly.g.cs
@@ -168,6 +168,36 @@ public async Task> PlainToShadowAsync(Pocos.makeread
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.makereadonly.MembersWithMakeReadOnly plain, Pocos.makereadonly.MembersWithMakeReadOnly latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.makeReadOnceMember != makeReadOnceMember.LastValue)
+ somethingChanged = true;
+ if (plain.someOtherMember != someOtherMember.LastValue)
+ somethingChanged = true;
+ if (await makeReadComplexMember.DetectsAnyChangeAsync(plain.makeReadComplexMember, latest.makeReadComplexMember))
+ somethingChanged = true;
+ if (await someotherComplexMember.DetectsAnyChangeAsync(plain.someotherComplexMember, latest.someotherComplexMember))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -369,6 +399,32 @@ public async Task> PlainToShadowAsync(Pocos.makeread
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.makereadonly.ComplexMember plain, Pocos.makereadonly.ComplexMember latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.someMember != someMember.LastValue)
+ somethingChanged = true;
+ if (plain.someOtherMember != someOtherMember.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/misc.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/misc.g.cs
index 3b93bf25..be130728 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/misc.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/misc.g.cs
@@ -124,6 +124,32 @@ public async Task> PlainToShadowAsync(Pocos.Enums.Cl
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.Enums.ClassWithEnums plain, Pocos.Enums.ClassWithEnums latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.colors != (Enums.Colors)latest.colors)
+ somethingChanged = true;
+ if (plain.NamedValuesColors != NamedValuesColors.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -354,6 +380,32 @@ public async Task> PlainToShadowAsync(Pocos.misc.Var
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.misc.VariousMembers plain, Pocos.misc.VariousMembers latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await _SomeClass.DetectsAnyChangeAsync(plain._SomeClass, latest._SomeClass))
+ somethingChanged = true;
+ if (await _Motor.DetectsAnyChangeAsync(plain._Motor, latest._Motor))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -540,6 +592,30 @@ public async Task> PlainToShadowAsync(Pocos.misc.Som
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.misc.SomeClass plain, Pocos.misc.SomeClass latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.SomeClassVariable != SomeClassVariable.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -720,6 +796,30 @@ public async Task> PlainToShadowAsync(Pocos.misc.Mot
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.misc.Motor plain, Pocos.misc.Motor latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (plain.isRunning != isRunning.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -921,6 +1021,32 @@ public async Task> PlainToShadowAsync(Pocos.misc.Veh
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.misc.Vehicle plain, Pocos.misc.Vehicle latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (await m.DetectsAnyChangeAsync(plain.m, latest.m))
+ somethingChanged = true;
+ if (plain.displacement != displacement.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -1139,6 +1265,40 @@ public async Task> PlainToShadowAsync(Pocos.UnknownA
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.UnknownArraysShouldNotBeTraspiled.ClassWithArrays plain, Pocos.UnknownArraysShouldNotBeTraspiled.ClassWithArrays latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ for (int i760901_3001_mimi = 0; i760901_3001_mimi < latest._complexKnown.Length; i760901_3001_mimi++)
+ {
+ if (await _complexKnown.ElementAt(i760901_3001_mimi).DetectsAnyChangeAsync(plain._complexKnown[i760901_3001_mimi], latest._complexKnown[i760901_3001_mimi]))
+ somethingChanged = true;
+ }
+
+ for (int i760901_3001_mimi = 0; i760901_3001_mimi < latest._primitive.Length; i760901_3001_mimi++)
+ {
+ if (latest._primitive.ElementAt(i760901_3001_mimi) != plain._primitive[i760901_3001_mimi])
+ somethingChanged = true;
+ }
+
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -1340,6 +1500,32 @@ public async Task> PlainToShadowAsync(Pocos.UnknownA
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.UnknownArraysShouldNotBeTraspiled.Complex plain, Pocos.UnknownArraysShouldNotBeTraspiled.Complex latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.HelloString != HelloString.LastValue)
+ somethingChanged = true;
+ if (plain.Id != Id.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/mixed_access.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/mixed_access.g.cs
index 75b51b17..318b3d82 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/mixed_access.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/mixed_access.g.cs
@@ -148,6 +148,30 @@ public async Task> PlainToShadowAsync(Pocos.Motor pl
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.Motor plain, Pocos.Motor latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.Run != Run.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -334,6 +358,30 @@ public async Task> PlainToShadowAsync(Pocos.struct1
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.struct1 plain, Pocos.struct1 latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (await s2.DetectsAnyChangeAsync(plain.s2, latest.s2))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -520,6 +568,30 @@ public async Task> PlainToShadowAsync(Pocos.struct2
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.struct2 plain, Pocos.struct2 latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (await s3.DetectsAnyChangeAsync(plain.s3, latest.s3))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -706,6 +778,30 @@ public async Task> PlainToShadowAsync(Pocos.struct3
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.struct3 plain, Pocos.struct3 latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (await s4.DetectsAnyChangeAsync(plain.s4, latest.s4))
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -886,6 +982,30 @@ public async Task> PlainToShadowAsync(Pocos.struct4
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.struct4 plain, Pocos.struct4 latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (plain.s5 != s5.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -1087,6 +1207,32 @@ public async Task> PlainToShadowAsync(Pocos.Abstract
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.AbstractMotor plain, Pocos.AbstractMotor latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.Run != Run.LastValue)
+ somethingChanged = true;
+ if (plain.ReverseDirection != ReverseDirection.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -1266,6 +1412,30 @@ public async Task> PlainToShadowAsync(Pocos.GenericM
return this.RetrievePrimitives();
}
+ ///
+ public async override Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public new async Task DetectsAnyChangeAsync(Pocos.GenericMotor plain, Pocos.GenericMotor latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await base.DetectsAnyChangeAsync(plain))
+ return true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public new void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -1371,6 +1541,30 @@ public async Task> PlainToShadowAsync(Pocos.Specific
return this.RetrievePrimitives();
}
+ ///
+ public async override Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public new async Task DetectsAnyChangeAsync(Pocos.SpecificMotorA plain, Pocos.SpecificMotorA latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (await base.DetectsAnyChangeAsync(plain))
+ return true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public new void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/ref_to_simple.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/ref_to_simple.g.cs
index 3e06a0e8..2c4dfe74 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/ref_to_simple.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/ref_to_simple.g.cs
@@ -92,6 +92,28 @@ public async Task> PlainToShadowAsync(Pocos.RefToSim
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.RefToSimple.ref_to_simple plain, Pocos.RefToSimple.ref_to_simple latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -278,6 +300,30 @@ public async Task> PlainToShadowAsync(Pocos.RefToSim
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.RefToSimple.referenced plain, Pocos.RefToSimple.referenced latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ if (plain.b != b.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/simple_empty_class.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/simple_empty_class.g.cs
index 3fa72e36..6e9e8eaa 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/simple_empty_class.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/simple_empty_class.g.cs
@@ -90,6 +90,28 @@ public async Task> PlainToShadowAsync(Pocos.simple_c
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.simple_class plain, Pocos.simple_class latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/simple_empty_class_within_namespace.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/simple_empty_class_within_namespace.g.cs
index 42bd8172..49c36a50 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/simple_empty_class_within_namespace.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/simple_empty_class_within_namespace.g.cs
@@ -92,6 +92,28 @@ public async Task> PlainToShadowAsync(Pocos.sampleNa
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.sampleNamespace.simple_empty_class_within_namespace plain, Pocos.sampleNamespace.simple_empty_class_within_namespace latest = null)
+ {
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ var somethingChanged = false;
+ return await Task.Run(async () =>
+ {
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/struct_simple.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/struct_simple.g.cs
index 1c5e48dc..484d813b 100644
--- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/struct_simple.g.cs
+++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/struct_simple.g.cs
@@ -99,6 +99,30 @@ public async Task> PlainToShadowAsync(Pocos.Motor pl
return this.RetrievePrimitives();
}
+ ///
+ public async virtual Task AnyChangeAsync(T plain)
+ {
+ return await this.DetectsAnyChangeAsync((dynamic)plain);
+ }
+
+ ///
+ ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated.
+ ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed.
+ ///
+ public async Task DetectsAnyChangeAsync(Pocos.Motor plain, Pocos.Motor latest = null)
+ {
+ var somethingChanged = false;
+ if (latest == null)
+ latest = await this._OnlineToPlainNoacAsync();
+ return await Task.Run(async () =>
+ {
+ if (plain.isRunning != isRunning.LastValue)
+ somethingChanged = true;
+ plain = latest;
+ return somethingChanged;
+ });
+ }
+
public void Poll()
{
this.RetrievePrimitives().ToList().ForEach(x => x.Poll());
@@ -300,6 +324,32 @@ public async Task