IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
FileDescriptorAccessor.cs
Go to the documentation of this file.
1using System;
2using System.IO;
3using System.Net.Sockets;
4using System.Threading;
5using System.Threading.Tasks;
6
8{
9
10#if FIRST_PASS == false && EXPORTER == false && IMPORTER == false
11
15 internal sealed class FileDescriptorAccessor : Accessor<object>
16 {
17
18 Type javaIoFileDescriptor;
19
20 FieldAccessor<object> @in;
21 FieldAccessor<object> @out;
22 FieldAccessor<object> @err;
23
24 FieldAccessor<object, Stream> stream;
25 FieldAccessor<object, long> ptr;
26 PropertyAccessor<object, int> fd;
27 PropertyAccessor<object, long> handle;
28 MethodAccessor<Func<object>> init;
29 MethodAccessor<Action<object>> sync;
30
35 public FileDescriptorAccessor(AccessorTypeResolver resolver) :
36 base(resolver, "java.io.FileDescriptor")
37 {
38
39 }
40
45 public object Init() => GetConstructor(ref init).Invoker();
46
50 public object GetIn() => GetField(ref @in, nameof(@in)).GetValue();
51
55 public object GetOut() => GetField(ref @out, nameof(@out)).GetValue();
56
60 public object GetErr() => GetField(ref @err, nameof(@err)).GetValue();
61
65 public Stream GetStream(object self) => GetField(ref stream, nameof(stream)).GetValue(self);
66
70 public void SetStream(object self, Stream value) => GetField(ref stream, nameof(stream)).SetValue(self, value);
71
75 public long GetPtr(object self) => GetField(ref ptr, nameof(ptr)).GetValue(self);
76
80 public void SetPtr(object self, long value) => GetField(ref ptr, nameof(ptr)).SetValue(self, value);
81
85 public int GetFd(object self) => GetProperty(ref fd, nameof(fd)).GetValue(self);
86
90 public void SetFd(object self, int value) => GetProperty(ref fd, nameof(fd)).SetValue(self, value);
91
95 public long GetHandle(object self) => GetProperty(ref handle, nameof(handle)).GetValue(self);
96
100 public void SetHandle(object self, long value) => GetProperty(ref handle, nameof(handle)).SetValue(self, value);
101
106 public void InvokeSync(object self) => GetMethod(ref sync, nameof(sync), typeof(void)).Invoker(self);
107
108 }
109
110#endif
111
112}
IKVM.Reflection.Type Type