-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
task: made NumericInfo`1 into an abstract record and implemented a co…
…ncrete sealed subclass for each of the integer Primitively info types. Just like the new Double and Single info record types.
- Loading branch information
Showing
19 changed files
with
208 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Primitively; | ||
|
||
/// <summary> | ||
/// This class represents metadata properties common to all source generated Primitively numeric types. | ||
/// </summary> | ||
/// <param name="Type">The .NET type of the Primitively type.</param> | ||
/// <param name="Example">An optional example of the integer.</param> | ||
/// <param name="CreateFrom">A function that creates an instance of the Primitively type from a string.</param> | ||
/// <param name="Minimum">The minimum value that can be set on the source generated Primitively type.</param> | ||
/// <param name="Maximum">The maximum value that can be set on the source generated Primitively type.</param> | ||
public sealed record ByteInfo( | ||
Type Type, | ||
string? Example, | ||
Func<string?, IPrimitive> CreateFrom, | ||
byte Minimum, | ||
byte Maximum) | ||
: NumericInfo<byte>(DataType.Byte, Type, Example, CreateFrom, Minimum, Maximum); |
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Primitively; | ||
|
||
/// <summary> | ||
/// This class represents metadata properties common to all source generated Primitively numeric types. | ||
/// </summary> | ||
/// <param name="Type">The .NET type of the Primitively type.</param> | ||
/// <param name="Example">An optional example of the integer.</param> | ||
/// <param name="CreateFrom">A function that creates an instance of the Primitively type from a string.</param> | ||
/// <param name="Minimum">The minimum value that can be set on the source generated Primitively type.</param> | ||
/// <param name="Maximum">The maximum value that can be set on the source generated Primitively type.</param> | ||
public sealed record IntInfo( | ||
Type Type, | ||
string? Example, | ||
Func<string?, IPrimitive> CreateFrom, | ||
int Minimum, | ||
int Maximum) | ||
: NumericInfo<int>(DataType.Int, Type, Example, CreateFrom, Minimum, Maximum); |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Primitively; | ||
|
||
/// <summary> | ||
/// This class represents metadata properties common to all source generated Primitively numeric types. | ||
/// </summary> | ||
/// <param name="Type">The .NET type of the Primitively type.</param> | ||
/// <param name="Example">An optional example of the integer.</param> | ||
/// <param name="CreateFrom">A function that creates an instance of the Primitively type from a string.</param> | ||
/// <param name="Minimum">The minimum value that can be set on the source generated Primitively type.</param> | ||
/// <param name="Maximum">The maximum value that can be set on the source generated Primitively type.</param> | ||
public sealed record LongInfo( | ||
Type Type, | ||
string? Example, | ||
Func<string?, IPrimitive> CreateFrom, | ||
long Minimum, | ||
long Maximum) | ||
: NumericInfo<long>(DataType.Long, Type, Example, CreateFrom, Minimum, Maximum); |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Primitively; | ||
|
||
/// <summary> | ||
/// This class represents metadata properties common to all source generated Primitively numeric types. | ||
/// </summary> | ||
/// <param name="Type">The .NET type of the Primitively type.</param> | ||
/// <param name="Example">An optional example of the integer.</param> | ||
/// <param name="CreateFrom">A function that creates an instance of the Primitively type from a string.</param> | ||
/// <param name="Minimum">The minimum value that can be set on the source generated Primitively type.</param> | ||
/// <param name="Maximum">The maximum value that can be set on the source generated Primitively type.</param> | ||
public sealed record SByteInfo( | ||
Type Type, | ||
string? Example, | ||
Func<string?, IPrimitive> CreateFrom, | ||
sbyte Minimum, | ||
sbyte Maximum) | ||
: NumericInfo<sbyte>(DataType.SByte, Type, Example, CreateFrom, Minimum, Maximum); |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Primitively; | ||
|
||
/// <summary> | ||
/// This class represents metadata properties common to all source generated Primitively numeric types. | ||
/// </summary> | ||
/// <param name="Type">The .NET type of the Primitively type.</param> | ||
/// <param name="Example">An optional example of the integer.</param> | ||
/// <param name="CreateFrom">A function that creates an instance of the Primitively type from a string.</param> | ||
/// <param name="Minimum">The minimum value that can be set on the source generated Primitively type.</param> | ||
/// <param name="Maximum">The maximum value that can be set on the source generated Primitively type.</param> | ||
public sealed record ShortInfo( | ||
Type Type, | ||
string? Example, | ||
Func<string?, IPrimitive> CreateFrom, | ||
short Minimum, | ||
short Maximum) | ||
: NumericInfo<short>(DataType.Short, Type, Example, CreateFrom, Minimum, Maximum); |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Primitively; | ||
|
||
/// <summary> | ||
/// This class represents metadata properties common to all source generated Primitively numeric types. | ||
/// </summary> | ||
/// <param name="Type">The .NET type of the Primitively type.</param> | ||
/// <param name="Example">An optional example of the integer.</param> | ||
/// <param name="CreateFrom">A function that creates an instance of the Primitively type from a string.</param> | ||
/// <param name="Minimum">The minimum value that can be set on the source generated Primitively type.</param> | ||
/// <param name="Maximum">The maximum value that can be set on the source generated Primitively type.</param> | ||
public sealed record UIntInfo( | ||
Type Type, | ||
string? Example, | ||
Func<string?, IPrimitive> CreateFrom, | ||
uint Minimum, | ||
uint Maximum) | ||
: NumericInfo<uint>(DataType.UInt, Type, Example, CreateFrom, Minimum, Maximum); |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Primitively; | ||
|
||
/// <summary> | ||
/// This class represents metadata properties common to all source generated Primitively numeric types. | ||
/// </summary> | ||
/// <param name="Type">The .NET type of the Primitively type.</param> | ||
/// <param name="Example">An optional example of the integer.</param> | ||
/// <param name="CreateFrom">A function that creates an instance of the Primitively type from a string.</param> | ||
/// <param name="Minimum">The minimum value that can be set on the source generated Primitively type.</param> | ||
/// <param name="Maximum">The maximum value that can be set on the source generated Primitively type.</param> | ||
public sealed record ULongInfo( | ||
Type Type, | ||
string? Example, | ||
Func<string?, IPrimitive> CreateFrom, | ||
ulong Minimum, | ||
ulong Maximum) | ||
: NumericInfo<ulong>(DataType.ULong, Type, Example, CreateFrom, Minimum, Maximum); |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Primitively; | ||
|
||
/// <summary> | ||
/// This class represents metadata properties common to all source generated Primitively numeric types. | ||
/// </summary> | ||
/// <param name="Type">The .NET type of the Primitively type.</param> | ||
/// <param name="Example">An optional example of the integer.</param> | ||
/// <param name="CreateFrom">A function that creates an instance of the Primitively type from a string.</param> | ||
/// <param name="Minimum">The minimum value that can be set on the source generated Primitively type.</param> | ||
/// <param name="Maximum">The maximum value that can be set on the source generated Primitively type.</param> | ||
public sealed record UShortInfo( | ||
Type Type, | ||
string? Example, | ||
Func<string?, IPrimitive> CreateFrom, | ||
ushort Minimum, | ||
ushort Maximum) | ||
: NumericInfo<ushort>(DataType.UShort, Type, Example, CreateFrom, Minimum, Maximum); |
Oops, something went wrong.