-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPointerTypeReference.cs
More file actions
34 lines (28 loc) · 1.68 KB
/
Copy pathPointerTypeReference.cs
File metadata and controls
34 lines (28 loc) · 1.68 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
using System;
namespace CodeMap.ReferenceData
{
/// <summary>Represents a pointer type reference.</summary>
public sealed class PointerTypeReference : BaseTypeReference
{
internal PointerTypeReference()
{
}
/// <summary>The type of the pointer.</summary>
public BaseTypeReference ReferentType { get; internal set; }
/// <summary>The declaring assembly.</summary>
public override AssemblyReference Assembly
=> ReferentType.Assembly;
/// <summary>Accepts the provided <paramref name="visitor"/> for selecting a concrete instance method.</summary>
/// <param name="visitor">The <see cref="MemberReferenceVisitor"/> interpreting the reference data.</param>
/// <exception cref="NullReferenceException">Thrown when <paramref name="visitor"/> is <c>null</c>.</exception>
public override void Accept(MemberReferenceVisitor visitor)
=> visitor.VisitPointer(this);
/// <summary>Determines whether the current <see cref="PointerTypeReference"/> is equal to the provided <paramref name="type"/>.</summary>
/// <param name="type">The <see cref="Type"/> to compare to.</param>
/// <returns>Returns <c>true</c> if the current <see cref="PointerTypeReference"/> references the provided <paramref name="type"/>; <c>false</c> otherwise.</returns>
public override bool Equals(Type type)
=> Equals(type, null, null);
internal override bool Equals(Type type, GenericMethodParameterReference originator, Type originatorMatch)
=> type is object && type.IsPointer && ReferentType.Equals(type.GetElementType(), originator, originatorMatch);
}
}