-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recorder_Enumerator: Distinct, Union, Intersect, and Except support.
- Loading branch information
Ben Rog-Wilhelm
committed
Oct 3, 2023
1 parent
b1a5160
commit 722ebc6
Showing
5 changed files
with
322 additions
and
2 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace Dec.RecorderEnumerator | ||
{ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Reflection; | ||
|
||
public static class SystemLinq_SingleLinkedNode_Converter | ||
{ | ||
internal static Type RelevantType = typeof(System.Linq.Enumerable).Assembly.GetType("System.Linq.SingleLinkedNode`1"); | ||
} | ||
|
||
public class SystemLinq_SingleLinkedNode_Converter<Node, T> : ConverterFactoryDynamic | ||
{ | ||
internal FieldInfo field_Item = typeof(Node).GetPrivateFieldInHierarchy("<Item>k__BackingField"); | ||
internal FieldInfo field_Linked = typeof(Node).GetPrivateFieldInHierarchy("<Linked>k__BackingField"); | ||
|
||
public override void Write(object input, Recorder recorder) | ||
{ | ||
recorder.Shared().RecordPrivate(input, field_Item, "item"); | ||
recorder.Shared().RecordPrivate(input, field_Linked, "linked"); | ||
} | ||
|
||
public override object Create(Recorder recorder) | ||
{ | ||
return Activator.CreateInstance(typeof(Node), new object[] { default(T) }); | ||
} | ||
|
||
public override void Read(ref object input, Recorder recorder) | ||
{ | ||
// it's the same code, we only need this for the funky Create | ||
Write(input, recorder); | ||
} | ||
} | ||
} |
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