-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
link markers with ils, code polishing
- Loading branch information
Showing
39 changed files
with
397 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
namespace Arinc424.Attributes; | ||
|
||
/// <summary> | ||
/// Specifies the index within an <c>ARINC-424</c> string. | ||
/// </summary> | ||
/// <remarks>Note that the index are exactly the same as those defined in the specification.</remarks> | ||
internal abstract class IndexAttribute(int index, Supplement supplement) : SupplementAttribute(supplement) | ||
/**<summary> | ||
Specifies the index within an <c>ARINC-424</c> string. | ||
</summary> | ||
<remarks>Note that the index are exactly the same as those defined in the specification.</remarks>*/ | ||
internal abstract class IndexAttribute(int index) : SupplementAttribute | ||
{ | ||
internal int Index { get; } = index - 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
namespace Arinc424.Attributes; | ||
|
||
/// <summary> | ||
/// Specifies the range of a field within an <c>ARINC-424</c> string. | ||
/// </summary> | ||
/// <remarks>Note that the bounds are exactly the same as those defined in the specification.</remarks> | ||
internal abstract class RangeAttribute(int left, int right, Supplement start) : SupplementAttribute(start) | ||
/**<summary> | ||
Specifies the range of a field within an <c>ARINC-424</c> string. | ||
</summary> | ||
<remarks>Note that the bounds are exactly the same as those defined in the specification.</remarks>*/ | ||
internal abstract class RangeAttribute(int left, int right) : SupplementAttribute | ||
{ | ||
internal Range Range { get; } = new Range(left - 1, right); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
namespace Arinc424.Attributes; | ||
|
||
/// <summary> | ||
/// A base attribute that can be versioned. | ||
/// </summary> | ||
internal abstract class SupplementAttribute(Supplement start, Supplement end = Supplement.V23) : Attribute | ||
/// <summary>A base attribute that can be versioned.</summary> | ||
internal abstract class SupplementAttribute : Attribute | ||
{ | ||
internal Supplement Start { get; } = start; | ||
public Supplement Start { get; set; } = Supplement.V18; | ||
|
||
internal Supplement End { get; } = end; | ||
public Supplement End { get; set; } = Supplement.V23; | ||
|
||
internal virtual bool IsTarget => false; | ||
|
||
/// <summary> | ||
/// Defines that a type matches the attribute. | ||
/// </summary> | ||
/// <typeparam name="TMatch">Type to match.</typeparam> | ||
/// <remarks><see langword="False"/> is forced cause non target attribute will be come by default.</remarks> | ||
/**<summary> | ||
Defines that a type matches the attribute. | ||
</summary> | ||
<typeparam name="TMatch">Type to match.</typeparam> | ||
<remarks><see langword="false"/> is forced cause non target attribute will be come by default.</remarks>*/ | ||
internal virtual bool IsMatch<TMatch>() where TMatch : Record424 => false; | ||
} |
23 changes: 11 additions & 12 deletions
23
source/library/attributes/building/CharacterAttribute{TRecord}.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
namespace Arinc424.Attributes; | ||
|
||
/// <summary> | ||
/// Specifies the index of <c>Continuation Record Number (CONT NR)</c> within an <c>ARINC-424</c> string. Default is 22. | ||
/// </summary> | ||
/// <remarks>See section 5.16.</remarks> | ||
/**<summary> | ||
Specifies the index of <c>Continuation Record Number (CONT NR)</c> within an <c>ARINC-424</c> string. Default is 22. | ||
</summary> | ||
<remarks>See section 5.16.</remarks>*/ | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] | ||
internal class ContinuousAttribute(int index = 22, Supplement supplement = Supplement.V18) : IndexAttribute(index, supplement); | ||
internal class ContinuousAttribute(int index = 22) : IndexAttribute(index); |
23 changes: 11 additions & 12 deletions
23
source/library/attributes/building/FieldAttribute{TRecord}.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 20 additions & 15 deletions
35
source/library/attributes/converting/DecodeAttribute{TConverter, TType}.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 10 additions & 8 deletions
18
source/library/attributes/converting/TransformAttribute{TConverter, TType}.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
namespace Arinc424.Attributes; | ||
|
||
/// <summary> | ||
/// Specifies that the character will be converted before assignment using <see cref="CharacterAttribute"/> index. | ||
/// </summary> | ||
internal abstract class TransformAttribute(Supplement start) : SupplementAttribute(start); | ||
/**<summary> | ||
Specifies that the character will be converted before assignment | ||
using <see cref="CharacterAttribute"/> index. | ||
</summary>*/ | ||
internal abstract class TransformAttribute : SupplementAttribute; | ||
|
||
/// <inheritdoc/> | ||
/// <typeparam name="TType">The type of value being converted from the character.</typeparam> | ||
internal abstract class TransformAttribute<TType>(Supplement start) : TransformAttribute(start) where TType : Enum | ||
internal abstract class TransformAttribute<TType> : TransformAttribute where TType : Enum | ||
{ | ||
internal abstract bool TryConvert(char @char, out TType value); | ||
} | ||
|
||
/// <inheritdoc/> | ||
/// <typeparam name="TConverter">Associated <see cref="ICharConverter{TType}"/>.</typeparam> | ||
/// <typeparam name="TType"> <inheritdoc/> </typeparam> | ||
/// <typeparam name="TType"><inheritdoc/></typeparam> | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Enum, AllowMultiple = true)] | ||
internal sealed class TransformAttribute<TConverter, TType>(Supplement start = Supplement.V18) : TransformAttribute<TType>(start) | ||
internal sealed class TransformAttribute<TConverter, TType> : TransformAttribute<TType> | ||
where TConverter : ICharConverter<TType> | ||
where TType : Enum | ||
{ | ||
internal override bool TryConvert(char @char, out TType value) => TConverter.TryConvert(@char, out value); | ||
internal override bool TryConvert(char @char, out TType value) | ||
=> TConverter.TryConvert(@char, out value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
namespace Arinc424.Attributes; | ||
|
||
/// <summary> | ||
/// Specifies indexes of section and subsection code to define related entity type. | ||
/// </summary> | ||
/// <summary>Specifies indexes of section and subsection code to define related entity type.</summary> | ||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] | ||
internal class TypeAttribute(int sectionIndex, int subsectionIndex, Supplement start = Supplement.V18) : SupplementAttribute(start) | ||
internal class TypeAttribute(int sectionIndex, int subsectionIndex) : SupplementAttribute | ||
{ | ||
/// <summary> | ||
/// Index of the section character. | ||
/// </summary> | ||
/// <summary>Index of the section character.</summary> | ||
internal int SectionIndex = sectionIndex - 1; | ||
|
||
/// <summary> | ||
/// Index of the subsection character. | ||
/// </summary> | ||
/// <summary>Index of the subsection character.</summary> | ||
internal int SubsectionIndex = subsectionIndex - 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.