forked from 9ee1/Capstone.NET
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNativeInstructionCollection.cs
55 lines (50 loc) · 1.83 KB
/
NativeInstructionCollection.cs
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
using System;
using System.Collections;
using System.Collections.Generic;
namespace Gee.External.Capstone {
/// <summary>
/// Native Instruction Collection.
/// </summary>
[Obsolete("Deprecated.")]
internal sealed class NativeInstructionCollection : IEnumerable<NativeInstruction> {
/// <summary>
/// Native Instructions.
/// </summary>
private readonly NativeInstruction[] _nativeInstructions;
/// <summary>
/// Pointer to Native Instructions in Unmanaged Memory.
/// </summary>
private readonly IntPtr _pNativeInstructions;
/// <summary>
/// Create a Native Instruction Collection.
/// </summary>
/// <param name="nativeInstructions">
/// An array of native instructions. Should not be a null reference.
/// </param>
/// <param name="pNativeInstructions">
/// A pointer to the array of native instructions in unmanaged memory.
/// </param>
internal NativeInstructionCollection(NativeInstruction[] nativeInstructions, IntPtr pNativeInstructions) {
this._nativeInstructions = nativeInstructions;
this._pNativeInstructions = pNativeInstructions;
}
/// <summary>
/// Get Enumerator.
/// </summary>
/// <returns>
/// An enumerator.
/// </returns>
public IEnumerator<NativeInstruction> GetEnumerator() {
return new NativeInstructionCollectionEnumerator(this._nativeInstructions, this._pNativeInstructions);
}
/// <summary>
/// Get Enumerator.
/// </summary>
/// <returns>
/// An enumerator.
/// </returns>
IEnumerator IEnumerable.GetEnumerator() {
return this.GetEnumerator();
}
}
}