Line | |
---|
1 | #region License Information
|
---|
2 | /*
|
---|
3 | * This file is part of SimSharp which is licensed under the MIT license.
|
---|
4 | * See the LICENSE file in the project root for more information.
|
---|
5 | */
|
---|
6 | #endregion
|
---|
7 |
|
---|
8 | using System;
|
---|
9 |
|
---|
10 | namespace SimSharp {
|
---|
11 | public class Request : Event, IDisposable {
|
---|
12 | private readonly Action<Event> disposeCallback;
|
---|
13 | public DateTime Time { get; private set; }
|
---|
14 | public Process Owner { get; set; }
|
---|
15 |
|
---|
16 | public Request(Simulation environment, Action<Event> callback, Action<Event> disposeCallback)
|
---|
17 | : base(environment) {
|
---|
18 | CallbackList.Add(callback);
|
---|
19 | this.disposeCallback = disposeCallback;
|
---|
20 | Time = environment.Now;
|
---|
21 | Owner = environment.ActiveProcess;
|
---|
22 | }
|
---|
23 |
|
---|
24 | public virtual void Dispose() {
|
---|
25 | if (disposeCallback != null) disposeCallback(this);
|
---|
26 | }
|
---|
27 | }
|
---|
28 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.