Class LongPtr
java.lang.Object
overrungl.struct.GroupType
overrungl.util.LongPtr
- All Implemented Interfaces:
Addressable
- Direct Known Subclasses:
LongPtr.Buffer
Layout
struct LongPtr {
jlong value;
};
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GroupLayout
The struct layout ofLongPtr
.static final MemoryLayout
The memory layout ofvalue
.static final long
The byte offset ofvalue
.static final VarHandle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LongPtr
alloc
(SegmentAllocator allocator) Allocates aLongPtr
with the given segment allocator.static LongPtr.Buffer
alloc
(SegmentAllocator allocator, long count) Allocates aLongPtr
with the given segment allocator and count.static LongPtr
allocInit
(SegmentAllocator allocator, long value) Allocates aLongPtr
with the given segment allocator and arguments like initializer list.asBuffer()
Converts this instance to a buffer.Copies from the given source.static LongPtr.Buffer
of
(MemorySegment segment) CreatesLongPtr
with the given segment.static LongPtr
ofNative
(MemorySegment segment) CreatesLongPtr
with the given segment.static LongPtr.Buffer
ofNative
(MemorySegment segment, long count) CreatesLongPtr
with the given segment.long
value()
Returnsvalue
.value
(long value) Setsvalue
with the given value.static long
value
(MemorySegment segment, long index) Returnsvalue
at the given index.static void
value
(MemorySegment segment, long index, long value) Setsvalue
with the given value at the given index.Methods inherited from class overrungl.struct.GroupType
estimateCount, estimateCount, groupLayout, segment
-
Field Details
-
LAYOUT
The struct layout ofLongPtr
. -
OFFSET_value
public static final long OFFSET_valueThe byte offset ofvalue
. -
LAYOUT_value
The memory layout ofvalue
. -
VH_value
-
-
Constructor Details
-
LongPtr
CreatesLongPtr
with the given segment.- Parameters:
segment
- the memory segment
-
-
Method Details
-
of
CreatesLongPtr
with the given segment.- Parameters:
segment
- the memory segment- Returns:
- the created instance or
null
if the segment isNULL
-
ofNative
Creates
LongPtr
with the given segment.Reinterprets the segment if zero-length.
- Parameters:
segment
- the memory segment- Returns:
- the created instance or
null
if the segment isNULL
-
ofNative
Creates
LongPtr
with the given segment.Reinterprets the segment if zero-length.
- Parameters:
segment
- the memory segmentcount
- the count of the buffer- Returns:
- the created instance or
null
if the segment isNULL
-
alloc
Allocates aLongPtr
with the given segment allocator.- Parameters:
allocator
- the segment allocator- Returns:
- the allocated
LongPtr
-
alloc
Allocates aLongPtr
with the given segment allocator and count.- Parameters:
allocator
- the segment allocatorcount
- the count- Returns:
- the allocated
LongPtr
-
allocInit
Allocates aLongPtr
with the given segment allocator and arguments like initializer list.- Parameters:
allocator
- the segment allocatorvalue
-value
- Returns:
- the allocated
LongPtr
-
copyFrom
-
asBuffer
-
value
Returnsvalue
at the given index.- Parameters:
segment
- the segment of the structindex
- the index of the struct buffer- Returns:
value
at the given index
-
value
public long value()Returnsvalue
.- Returns:
value
-
value
Setsvalue
with the given value at the given index.- Parameters:
segment
- the segment of the structindex
- the index of the struct buffervalue
- the value
-
value
Setsvalue
with the given value.- Parameters:
value
- the value- Returns:
this
-