3using System.Net.Sockets;
5using System.Threading.Tasks;
10#if FIRST_PASS == false && EXPORTER == false && IMPORTER == false
15 internal sealed class FileDescriptorAccessor : Accessor<object>
18 Type javaIoFileDescriptor;
20 FieldAccessor<object> @in;
21 FieldAccessor<object> @out;
22 FieldAccessor<object> @err;
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;
35 public FileDescriptorAccessor(AccessorTypeResolver resolver) :
36 base(resolver,
"java.io.FileDescriptor")
45 public object Init() => GetConstructor(
ref init).Invoker();
50 public object GetIn() => GetField(
ref @in, nameof(@in)).GetValue();
55 public object GetOut() => GetField(
ref @out, nameof(@out)).GetValue();
60 public object GetErr() => GetField(
ref @err, nameof(@err)).GetValue();
65 public Stream GetStream(
object self) => GetField(
ref stream, nameof(stream)).GetValue(
self);
70 public void SetStream(
object self, Stream value) => GetField(
ref stream, nameof(stream)).SetValue(
self, value);
75 public long GetPtr(
object self) => GetField(
ref ptr, nameof(ptr)).GetValue(
self);
80 public void SetPtr(
object self,
long value) => GetField(
ref ptr, nameof(ptr)).SetValue(
self, value);
85 public int GetFd(
object self) => GetProperty(
ref fd, nameof(fd)).GetValue(
self);
90 public void SetFd(
object self,
int value) => GetProperty(
ref fd, nameof(fd)).SetValue(
self, value);
95 public long GetHandle(
object self) => GetProperty(
ref handle, nameof(handle)).GetValue(
self);
100 public void SetHandle(
object self,
long value) => GetProperty(
ref handle, nameof(handle)).SetValue(
self, value);
106 public void InvokeSync(
object self) => GetMethod(
ref sync, nameof(sync), typeof(
void)).Invoker(
self);
IKVM.Reflection.Type Type