IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
FunctionPointerType.cs
Go to the documentation of this file.
1/*
2 Copyright (C) 2009-2015 Jeroen Frijters
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 Jeroen Frijters
21 jeroen@frijters.net
22
23*/
24using System;
25
26namespace IKVM.Reflection
27{
28
29 sealed class FunctionPointerType : TypeInfo
30 {
31
32 readonly Universe universe;
33 readonly __StandAloneMethodSig sig;
34
35 internal static Type Make(Universe universe, __StandAloneMethodSig sig)
36 {
37 return universe.CanonicalizeType(new FunctionPointerType(universe, sig));
38 }
39
45 FunctionPointerType(Universe universe, __StandAloneMethodSig sig) :
46 base(Signature.ELEMENT_TYPE_FNPTR)
47 {
48 this.universe = universe;
49 this.sig = sig;
50 }
51
52 public override bool Equals(object obj)
53 {
54 var other = obj as FunctionPointerType;
55 return other != null
56 && other.universe == universe
57 && other.sig.Equals(sig);
58 }
59
60 public override int GetHashCode()
61 {
62 return sig.GetHashCode();
63 }
64
65 public override __StandAloneMethodSig __MethodSignature
66 {
67 get { return sig; }
68 }
69
70 public override Type BaseType
71 {
72 get { return null; }
73 }
74
75 public override TypeAttributes Attributes
76 {
77 get { return 0; }
78 }
79
80 public override string Name
81 {
82 get { throw new InvalidOperationException(); }
83 }
84
85 public override string FullName
86 {
87 get { throw new InvalidOperationException(); }
88 }
89
90 public override Module Module
91 {
92 get { throw new InvalidOperationException(); }
93 }
94
95 internal override Universe Universe
96 {
97 get { return universe; }
98 }
99
100 public override string ToString()
101 {
102 return "<FunctionPtr>";
103 }
104
105 protected override bool ContainsMissingTypeImpl
106 {
107 get { return sig.ContainsMissingType; }
108 }
109
110 internal override bool IsBaked
111 {
112 get { return true; }
113 }
114
115 protected override bool IsValueTypeImpl
116 {
117 get { return false; }
118 }
119
120 }
121
122}
global::java.lang.invoke.LambdaForm.Name Name
override __StandAloneMethodSig __MethodSignature