forked from cschladetsch/CsharpFlow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIGroup.cs
More file actions
41 lines (32 loc) · 1.29 KB
/
Copy pathIGroup.cs
File metadata and controls
41 lines (32 loc) · 1.29 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
// (C) 2012 Christian Schladetsch. See https://github.com/cschladetsch/Flow.
namespace Flow
{
using System.Collections.Generic;
public delegate void GroupHandler(IGroup node, ITransient child);
/// <inheritdoc />
/// <summary>
/// A Group contains a collection of other Transients, and fires events when the
/// contents of the group changes.
///
/// <para>When a Group is stepped, nothing happens.</para>
/// <para>When a Group is resumed, all child generators are also resumed.</para>
/// <para>When a Group is suspended, all child generators are also suspended.</para>
/// </summary>
public interface IGroup
: IGenerator
{
IList<ITransient> Contents { get; }
IEnumerable<IGenerator> Generators { get; }
bool Empty { get; }
// Occurs when a transient is added to this group.
event GroupHandler OnAdded;
// Occurs when a transient is removed from this group.
event GroupHandler OnRemoved;
// Add the specified transient to this group iff it is not already a member
// of this group.
void Add(IEnumerable<ITransient> trans);
void Add(params ITransient[] trans);
// Remove the specified transient from this group.
void Remove(ITransient trans);
}
}