-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDependencyQueueError.cs
More file actions
59 lines (54 loc) · 2.05 KB
/
Copy pathDependencyQueueError.cs
File metadata and controls
59 lines (54 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright Subatomix Research Inc.
// SPDX-License-Identifier: MIT
namespace DependencyQueue;
/// <summary>
/// A <see cref="DependencyQueue{T}"/> validation error.
/// </summary>
public abstract class DependencyQueueError
{
private protected DependencyQueueError() { }
/// <summary>
/// Gets the type of the error.
/// </summary>
public abstract DependencyQueueErrorType Type { get; }
/// <summary>
/// Creates a <see cref="DependencyQueueError"/> instance to report that
/// one or more items require a topic that no items provide.
/// </summary>
/// <typeparam name="T">
/// The type of values contained in queue items.
/// </typeparam>
/// <param name="topic">
/// The topic that is required but not provided.
/// </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="topic"/> is <see langword="null"/>.
/// </exception>
public static DependencyQueueUnprovidedTopicError<T>
UnprovidedTopic<T>(DependencyQueueTopic<T> topic)
=> new(topic);
/// <summary>
/// Creates a <see cref="DependencyQueueError"/> instance to report a
/// cycle in the dependency graph.
/// </summary>
/// <typeparam name="T">
/// The type of values contained in queue items.
/// </typeparam>
/// <param name="requiringItem">
/// The item whose requirement of <paramref name="requiredTopic"/>
/// creates a cycle in the dependency graph.
/// </param>
/// <param name="requiredTopic">
/// The topic whose requirement by <paramref name="requiringItem"/>
/// creates a cycle in the dependency graph.
/// </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="requiringItem"/> and/or
/// <paramref name="requiredTopic"/> is <see langword="null"/>.
/// </exception>
public static DependencyQueueCycleError<T>
Cycle<T>(
DependencyQueueItem<T> requiringItem,
DependencyQueueTopic<T> requiredTopic)
=> new(requiringItem, requiredTopic);
}