Package org.gnome.glib
Class UnixPipe
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.glib.UnixPipe
- All Implemented Interfaces:
Proxy
A Unix pipe. The advantage of this type over
int[2]
is that it can
be closed automatically when it goes out of scope, using g_auto(GUnixPipe)
,
on compilers that support that feature.-
Constructor Summary
ConstructorDescriptionUnixPipe()
Allocate a new UnixPipe.UnixPipe
(int[] fds) Allocate a new UnixPipe with the fields set to the provided values.Allocate a new UnixPipe with the fields set to the provided values.Allocate a new UnixPipe.UnixPipe
(MemorySegment address) Create a UnixPipe proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.int[]
readFds()
Read the value of the fieldfds
.void
Write a value in the fieldfds
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
UnixPipe
Create a UnixPipe proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
UnixPipe
Allocate a new UnixPipe.- Parameters:
arena
- to control the memory allocation scope
-
UnixPipe
public UnixPipe()Allocate a new UnixPipe. The memory is allocated withArena.ofAuto()
. -
UnixPipe
Allocate a new UnixPipe with the fields set to the provided values.- Parameters:
fds
- value for the fieldfds
arena
- to control the memory allocation scope
-
UnixPipe
public UnixPipe(int[] fds) Allocate a new UnixPipe with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
fds
- value for the fieldfds
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readFds
public int[] readFds()Read the value of the fieldfds
.- Returns:
- The value of the field
fds
-
writeFds
Write a value in the fieldfds
.- Parameters:
fds
- The new value for the fieldfds
_arena
- to control the memory allocation scope
-