Skip to content

Commit 0f4b8f9

Browse files
committed
Split IArithmeticQuantity to its own file
1 parent b560b48 commit 0f4b8f9

File tree

2 files changed

+37
-30
lines changed

2 files changed

+37
-30
lines changed

UnitsNet/IArithmeticQuantity.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Licensed under MIT No Attribution, see LICENSE file at the root.
2+
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet.
3+
4+
using System;
5+
using System.Numerics;
6+
7+
namespace UnitsNet;
8+
9+
/// <summary>
10+
/// An <see cref="IQuantity{TSelf, TUnitType, TValueType}"/> that (in .NET 7+) implements generic math interfaces for arithmetic operations.
11+
/// </summary>
12+
/// <typeparam name="TSelf">The type itself, for the CRT pattern.</typeparam>
13+
/// <typeparam name="TUnitType">The underlying unit enum type.</typeparam>
14+
/// <typeparam name="TValueType">The underlying value type for internal representation.</typeparam>
15+
public interface IArithmeticQuantity<TSelf, TUnitType, TValueType> : IQuantity<TSelf, TUnitType, TValueType>
16+
#if NET7_0_OR_GREATER
17+
, IAdditionOperators<TSelf, TSelf, TSelf>
18+
, IAdditiveIdentity<TSelf, TSelf>
19+
, ISubtractionOperators<TSelf, TSelf, TSelf>
20+
, IMultiplyOperators<TSelf, TValueType, TSelf>
21+
, IDivisionOperators<TSelf, TValueType, TSelf>
22+
, IUnaryNegationOperators<TSelf, TSelf>
23+
#endif
24+
where TSelf : IArithmeticQuantity<TSelf, TUnitType, TValueType>
25+
where TUnitType : Enum
26+
where TValueType : struct
27+
#if NET7_0_OR_GREATER
28+
, INumber<TValueType>
29+
#endif
30+
{
31+
#if NET7_0_OR_GREATER
32+
/// <summary>
33+
/// The zero value of this quantity.
34+
/// </summary>
35+
static abstract TSelf Zero { get; }
36+
#endif
37+
}

UnitsNet/IQuantity.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -133,34 +133,4 @@ public interface IQuantity<TSelf, TUnitType, TValueType> : IQuantity<TUnitType>
133133
where TValueType : struct
134134
{
135135
}
136-
137-
/// <summary>
138-
/// An <see cref="IQuantity{TSelf, TUnitType, TValueType}"/> that (in .NET 7+) implements generic math interfaces for arithmetic operations.
139-
/// </summary>
140-
/// <typeparam name="TSelf">The type itself, for the CRT pattern.</typeparam>
141-
/// <typeparam name="TUnitType">The underlying unit enum type.</typeparam>
142-
/// <typeparam name="TValueType">The underlying value type for internal representation.</typeparam>
143-
public interface IArithmeticQuantity<TSelf, TUnitType, TValueType> : IQuantity<TSelf, TUnitType, TValueType>
144-
#if NET7_0_OR_GREATER
145-
, IAdditionOperators<TSelf, TSelf, TSelf>
146-
, IAdditiveIdentity<TSelf, TSelf>
147-
, ISubtractionOperators<TSelf, TSelf, TSelf>
148-
, IMultiplyOperators<TSelf, TValueType, TSelf>
149-
, IDivisionOperators<TSelf, TValueType, TSelf>
150-
, IUnaryNegationOperators<TSelf, TSelf>
151-
#endif
152-
where TSelf : IArithmeticQuantity<TSelf, TUnitType, TValueType>
153-
where TUnitType : Enum
154-
where TValueType : struct
155-
#if NET7_0_OR_GREATER
156-
, INumber<TValueType>
157-
#endif
158-
{
159-
#if NET7_0_OR_GREATER
160-
/// <summary>
161-
/// The zero value of this quantity.
162-
/// </summary>
163-
static abstract TSelf Zero { get; }
164-
#endif
165-
}
166136
}

0 commit comments

Comments
 (0)