Skip to content

Commit 3946038

Browse files
[Add] hand-coded AcceptActionUsageExtensions extension methods to compute the derived properties
1 parent 9dab59f commit 3946038

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// -------------------------------------------------------------------------------------------------
2+
// <copyright file="AcceptActionUsageExtensions.cs" company="Starion Group S.A.">
3+
//
4+
// Copyright 2022-2025 Starion Group S.A.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// </copyright>
19+
// ------------------------------------------------------------------------------------------------
20+
21+
namespace SysML2.NET.Core.POCO.Systems.Actions
22+
{
23+
using System;
24+
25+
using SysML2.NET.Core.POCO.Systems.DefinitionAndUsage;
26+
using SysML2.NET.Core.POCO.Kernel.Functions;
27+
28+
/// <summary>
29+
/// The <see cref="AcceptActionUsageExtensions"/> class provides extensions methods for <see cref="IAcceptActionUsage"/>
30+
/// </summary>
31+
internal static class AcceptActionUsageExtensions
32+
{
33+
/// <summary>
34+
/// Computes the derived property:
35+
/// An Expression whose result is bound to the payload parameter of this AcceptActionUsage. If provided,
36+
/// the AcceptActionUsage will only accept a Transfer with exactly this payload.
37+
/// </summary>
38+
/// <param name="acceptActionUsage">
39+
/// The subject <see cref="IAcceptActionUsage"/>
40+
/// </param>
41+
/// <returns>
42+
/// a <see cref="IExpression"/>
43+
/// </returns>
44+
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
45+
internal static IExpression ComputePayloadArgument(this IAcceptActionUsage acceptActionUsage)
46+
{
47+
throw new NotSupportedException("Create a GitHub issue when this method is required");
48+
}
49+
50+
/// <summary>
51+
/// Computes the derived property:
52+
/// The nestedReference of this AcceptActionUsage that redefines the payload output parameter of the
53+
/// base AcceptActionUsage AcceptAction from the Systems Model Library.
54+
/// </summary>
55+
/// <param name="acceptActionUsage">
56+
/// The subject <see cref="IAcceptActionUsage"/>
57+
/// </param>
58+
/// <returns>
59+
/// a <see cref="IReferenceUsage"/>
60+
/// </returns>
61+
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
62+
internal static IReferenceUsage ComputePayloadParameter(this IAcceptActionUsage acceptActionUsage)
63+
{
64+
throw new NotSupportedException("Create a GitHub issue when this method is required");
65+
}
66+
67+
/// <summary>
68+
/// Computes the derived property:
69+
/// An Expression whose result is bound to the receiver input parameter of this AcceptActionUsage.
70+
/// </summary>
71+
/// <param name="acceptActionUsage">
72+
/// The subject <see cref="IAcceptActionUsage"/>
73+
/// </param>
74+
/// <returns>
75+
/// a <see cref="IExpression"/>
76+
/// </returns>
77+
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
78+
internal static IExpression ComputeReceiverArgument(this IAcceptActionUsage acceptActionUsage)
79+
{
80+
throw new NotSupportedException("Create a GitHub issue when this method is required");
81+
}
82+
}
83+
}

SysML2.NET/SysML2.NET.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@
3434
<None Include="..\README.md" Pack="true" PackagePath="\" />
3535
</ItemGroup>
3636

37+
<ItemGroup>
38+
<Folder Include="Extend\" />
39+
</ItemGroup>
40+
3741
</Project>

0 commit comments

Comments
 (0)