1 #Region "Microsoft.VisualBasic::9989e7737202a17a6f05f122b8447845, Microsoft.VisualBasic.Core\Extensions\Reflection\Marshal\Pointers.vb"
2
3     ' Author:
4     
5     '       asuka (amethyst.asuka@gcmodeller.org)
6     '       xie (genetics@smrucc.org)
7     '       xieguigang (xie.guigang@live.com)
8     
9     ' Copyright (c) 2018 GPL3 Licensed
10     
11     
12     ' GNU GENERAL PUBLIC LICENSE (GPL3)
13     
14     
15     ' This program is free software: you can redistribute it and/or modify
16     ' it under the terms of the GNU General Public License as published by
17     ' the Free Software Foundation, either version 3 of the License, or
18     ' (at your option) any later version.
19     
20     ' This program is distributed in the hope that it will be useful,
21     ' but WITHOUT ANY WARRANTY; without even the implied warranty of
22     ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23     ' GNU General Public License for more details.
24     
25     ' You should have received a copy of the GNU General Public License
26     ' along with this program. If not, see <http://www.gnu.org/licenses/>.
27
28
29
30     ' /********************************************************************************/
31
32     ' Summaries:
33
34     '     Class [Integer]
35     
36     '         Constructor: (+1 OverloadsSub New
37     
38     '     Class [Char]
39     
40     '         Constructor: (+1 OverloadsSub New
41     
42     '     Class [Short]
43     
44     '         Constructor: (+1 OverloadsSub New
45     
46     '     Class [Long]
47     
48     '         Constructor: (+1 OverloadsSub New
49     
50     '     Class [Single]
51     
52     '         Constructor: (+1 OverloadsSub New
53     
54     '     Class [Byte]
55     
56     '         Constructor: (+1 OverloadsSub New
57     
58     '     Class [IntPtr]
59     
60     '         Constructor: (+1 OverloadsSub New
61     
62     '     Class [Double]
63     
64     '         Constructor: (+1 OverloadsSub New
65     
66     
67     ' /********************************************************************************/
68
69 #End Region
70
71 Imports System.Runtime.InteropServices.Marshal
72
73 Namespace Emit.Marshal
74
75     Public Class [Integer] : Inherits IntPtr(Of Integer)
76
77         Sub New(p As System.IntPtr, chunkSize As Integer)
78             Call MyBase.New(p, chunkSize, AddressOf Copy, AddressOf Copy)
79         End Sub
80     End Class
81
82     Public Class [Char] : Inherits IntPtr(Of Char)
83
84         Sub New(p As System.IntPtr, chunkSize As Integer)
85             Call MyBase.New(p, chunkSize, AddressOf Copy, AddressOf Copy)
86         End Sub
87     End Class
88
89     Public Class [Short] : Inherits IntPtr(Of Short)
90
91         Sub New(p As System.IntPtr, chunkSize As Integer)
92             Call MyBase.New(p, chunkSize, AddressOf Copy, AddressOf Copy)
93         End Sub
94     End Class
95
96     Public Class [Long] : Inherits IntPtr(Of Long)
97
98         Sub New(p As System.IntPtr, chunkSize As Integer)
99             Call MyBase.New(p, chunkSize, AddressOf Copy, AddressOf Copy)
100         End Sub
101     End Class
102
103     Public Class [Single] : Inherits IntPtr(Of Single)
104
105         Sub New(p As System.IntPtr, chunkSize As Integer)
106             Call MyBase.New(p, chunkSize, AddressOf Copy, AddressOf Copy)
107         End Sub
108     End Class
109
110     ''' <summary>
111     ''' Represents a pointer to an 8-bit unsigned integer array.
112     ''' </summary>
113     Public Class [Byte] : Inherits IntPtr(Of Byte)
114
115         ''' <summary>
116         ''' Represents a pointer to an 8-bit unsigned integer array.
117         ''' </summary>
118         ''' <param name="p">The start address location of the array in the memory</param>
119         ''' <param name="chunkSize">array length</param>
120         Sub New(p As System.IntPtr, chunkSize As Integer)
121             Call MyBase.New(p, chunkSize, AddressOf Copy, AddressOf Copy)
122         End Sub
123     End Class
124
125     Public Class [IntPtr] : Inherits IntPtr(Of System.IntPtr)
126
127         Sub New(p As System.IntPtr, chunkSize As Integer)
128             Call MyBase.New(p, chunkSize, AddressOf Copy, AddressOf Copy)
129         End Sub
130     End Class
131
132     Public Class [Double] : Inherits IntPtr(Of Double)
133
134         Sub New(p As System.IntPtr, chunkSize As Integer)
135             Call MyBase.New(p, chunkSize, AddressOf Copy, AddressOf Copy)
136         End Sub
137     End Class
138 End Namespace