-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathArrayTypeId.cs
More file actions
66 lines (53 loc) · 1.67 KB
/
Copy pathArrayTypeId.cs
File metadata and controls
66 lines (53 loc) · 1.67 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
namespace Tvl.Java.DebugInterface.Types
{
using System;
using System.Runtime.Serialization;
[DataContract]
public struct ArrayTypeId : IEquatable<ArrayTypeId>
{
[DataMember(IsRequired = true)]
public long Handle;
public ArrayTypeId(long handle)
{
Handle = handle;
}
public static implicit operator ReferenceTypeId(ArrayTypeId @array)
{
return new ReferenceTypeId(@array.Handle);
}
public static explicit operator ArrayTypeId(ReferenceTypeId referenceType)
{
return new ArrayTypeId(referenceType.Handle);
}
public static explicit operator ArrayTypeId(TaggedReferenceTypeId @object)
{
if (@object == default(TaggedReferenceTypeId))
return default(ArrayTypeId);
if (@object.TypeTag != TypeTag.Array)
throw new ArgumentException();
return new ArrayTypeId(@object.TypeId.Handle);
}
public static bool operator ==(ArrayTypeId x, ArrayTypeId y)
{
return x.Handle == y.Handle;
}
public static bool operator !=(ArrayTypeId x, ArrayTypeId y)
{
return x.Handle != y.Handle;
}
public bool Equals(ArrayTypeId other)
{
return this.Handle == other.Handle;
}
public override bool Equals(object obj)
{
if (!(obj is ArrayTypeId))
return false;
return this.Handle == ((ArrayTypeId)obj).Handle;
}
public override int GetHashCode()
{
return Handle.GetHashCode();
}
}
}