-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cleanup] Merging PEvent with Event (#764)
Co-authored-by: Christine Zhou <[email protected]>
- Loading branch information
1 parent
1567407
commit aa5e50b
Showing
52 changed files
with
202 additions
and
210 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,64 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Runtime.Serialization; | ||
using PChecker.PRuntime.Values; | ||
|
||
namespace PChecker.StateMachines.Events | ||
{ | ||
/// <summary> | ||
/// Abstract class representing an event. | ||
/// Class representing an event. | ||
/// </summary> | ||
[DataContract] | ||
public abstract class Event | ||
public class Event: IPrtValue | ||
{ | ||
public Event() | ||
{ | ||
} | ||
|
||
public Event(IPrtValue payload) | ||
{ | ||
Payload = payload; | ||
} | ||
|
||
public IPrtValue Payload { get; } | ||
|
||
public bool Equals(IPrtValue other) | ||
{ | ||
return other != null && GetType().FullName.Equals(other.GetType().FullName); | ||
} | ||
|
||
public virtual IPrtValue Clone() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public object ToDict() | ||
{ | ||
return this.GetType().Name; | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
return obj is Event other && Equals(other); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return GetType().FullName.GetHashCode(); | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return GetType().Name; | ||
} | ||
} | ||
|
||
public class PHalt : Event | ||
{ | ||
public PHalt(IPrtValue payload) : base(payload) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.