Skip to content

Switching quantity to class from struct #500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/Acceleration.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// Acceleration, in physics, is the rate at which the velocity of an object changes over time. An object's acceleration is the net result of any and all forces acting on the object, as described by Newton's Second Law. The SI unit for acceleration is the Meter per second squared (m/s²). Accelerations are vector quantities (they have magnitude and direction) and add according to the parallelogram law. As a vector, the calculated net force is equal to the product of the object's mass (a scalar quantity) and the acceleration.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class Acceleration : IQuantity
#else
public partial struct Acceleration : IQuantity, IComparable, IComparable<Acceleration>
#endif
public partial class Acceleration : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -429,6 +421,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(Acceleration other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// Mole is the amount of substance containing Avagadro's Number (6.02 x 10 ^ 23) of real particles such as molecules,atoms, ions or radicals.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class AmountOfSubstance : IQuantity
#else
public partial struct AmountOfSubstance : IQuantity, IComparable, IComparable<AmountOfSubstance>
#endif
public partial class AmountOfSubstance : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -448,6 +440,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(AmountOfSubstance other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// The strength of a signal expressed in decibels (dB) relative to one volt RMS.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class AmplitudeRatio : IQuantity
#else
public partial struct AmplitudeRatio : IQuantity, IComparable, IComparable<AmplitudeRatio>
#endif
public partial class AmplitudeRatio : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -257,6 +249,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(AmplitudeRatio other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/Angle.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// In geometry, an angle is the figure formed by two rays, called the sides of the angle, sharing a common endpoint, called the vertex of the angle.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class Angle : IQuantity
#else
public partial struct Angle : IQuantity, IComparable, IComparable<Angle>
#endif
public partial class Angle : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -447,6 +439,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(Angle other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// A unit for expressing the integral of apparent power over time, equal to the product of 1 volt-ampere and 1 hour, or to 3600 joules.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class ApparentEnergy : IQuantity
#else
public partial struct ApparentEnergy : IQuantity, IComparable, IComparable<ApparentEnergy>
#endif
public partial class ApparentEnergy : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -239,6 +231,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(ApparentEnergy other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// Power engineers measure apparent power as the magnitude of the vector sum of active and reactive power. Apparent power is the product of the root-mean-square of voltage and current.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class ApparentPower : IQuantity
#else
public partial struct ApparentPower : IQuantity, IComparable, IComparable<ApparentPower>
#endif
public partial class ApparentPower : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -258,6 +250,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(ApparentPower other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/Area.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// Area is a quantity that expresses the extent of a two-dimensional surface or shape, or planar lamina, in the plane. Area can be understood as the amount of material with a given thickness that would be necessary to fashion a model of the shape, or the amount of paint necessary to cover the surface with a single coat.[1] It is the two-dimensional analog of the length of a curve (a one-dimensional concept) or the volume of a solid (a three-dimensional concept).
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class Area : IQuantity
#else
public partial struct Area : IQuantity, IComparable, IComparable<Area>
#endif
public partial class Area : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -429,6 +421,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(Area other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// The area density of a two-dimensional object is calculated as the mass per unit area.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class AreaDensity : IQuantity
#else
public partial struct AreaDensity : IQuantity, IComparable, IComparable<AreaDensity>
#endif
public partial class AreaDensity : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -201,6 +193,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(AreaDensity other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// A geometric property of an area that reflects how its points are distributed with regard to an axis.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class AreaMomentOfInertia : IQuantity
#else
public partial struct AreaMomentOfInertia : IQuantity, IComparable, IComparable<AreaMomentOfInertia>
#endif
public partial class AreaMomentOfInertia : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -296,6 +288,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(AreaMomentOfInertia other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/BitRate.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// In telecommunications and computing, bit rate is the number of bits that are conveyed or processed per unit of time.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class BitRate : IQuantity
#else
public partial struct BitRate : IQuantity, IComparable, IComparable<BitRate>
#endif
public partial class BitRate : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -675,6 +667,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(BitRate other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// Brake specific fuel consumption (BSFC) is a measure of the fuel efficiency of any prime mover that burns fuel and produces rotational, or shaft, power. It is typically used for comparing the efficiency of internal combustion engines with a shaft output.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class BrakeSpecificFuelConsumption : IQuantity
#else
public partial struct BrakeSpecificFuelConsumption : IQuantity, IComparable, IComparable<BrakeSpecificFuelConsumption>
#endif
public partial class BrakeSpecificFuelConsumption : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -239,6 +231,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(BrakeSpecificFuelConsumption other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/Capacitance.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// Capacitance is the ability of a body to store an electric charge.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class Capacitance : IQuantity
#else
public partial struct Capacitance : IQuantity, IComparable, IComparable<Capacitance>
#endif
public partial class Capacitance : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -201,6 +193,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(Capacitance other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
13 changes: 4 additions & 9 deletions Common/GeneratedCode/Quantities/Density.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ namespace UnitsNet
/// The density, or more precisely, the volumetric mass density, of a substance is its mass per unit volume.
/// </summary>
// ReSharper disable once PartialTypeWithSinglePart

// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
#if WINDOWS_UWP
public sealed partial class Density : IQuantity
#else
public partial struct Density : IQuantity, IComparable, IComparable<Density>
#endif
public partial class Density : IQuantity
{
/// <summary>
/// The numeric value this quantity was constructed with.
Expand Down Expand Up @@ -904,6 +896,9 @@ public int CompareTo(object obj)
#endif
int CompareTo(Density other)
{
if(other is null)
throw new ArgumentNullException(nameof(other));

return _value.CompareTo(other.AsBaseNumericType(this.Unit));
}

Expand Down
Loading