Record Class SDL_IOStreamInterface
- All Implemented Interfaces:
IPointer
,ISDL_IOStreamInterface
The function pointers that drive an SDL_IOStream.
Applications can provide this struct to SDL_OpenIO() to create their own implementation of SDL_IOStream. This is not necessarily required, as SDL already offers several common types of I/O streams, via functions like SDL_IOFromFile() and SDL_IOFromMem().
This structure should be initialized using SDL_INIT_INTERFACE()
Since: This struct is available since SDL 3.2.0.
See also:
SDL_INIT_INTERFACE
Structure
typedef struct SDL_IOStreamInterface {
Uint32 version
;
PFN_SDL_IOStreamInterface_size
size
; // optional
PFN_SDL_IOStreamInterface_seek
seek
; // optional
PFN_SDL_IOStreamInterface_read
read
; // optional
PFN_SDL_IOStreamInterface_write
write
; // optional
PFN_SDL_IOStreamInterface_flush
flush
; // optional
PFN_SDL_IOStreamInterface_close
close
; // optional
} SDL_IOStreamInterface;
Contracts
The property segment()
should always be not-null
(segment != NULL && !segment.equals(MemorySegment.NULL)
), and properly aligned to
LAYOUT.byteAlignment()
bytes. To represent null pointer, you may use a Java
null
instead. See the documentation of IPointer.segment()
for more details.
The constructor of this class is marked as UnsafeConstructor
, because it does not
perform any runtime check. The constructor can be useful for automatic code generators.
Member documentation
size()
Return the number of bytes in this SDL_IOStream
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final StructLayout
static final AddressLayout
static final AddressLayout
static final AddressLayout
static final AddressLayout
static final AddressLayout
static final ValueLayout.OfInt
static final AddressLayout
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionSDL_IOStreamInterface
(@NotNull MemorySegment segment) Creates an instance of aSDL_IOStreamInterface
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_IOStreamInterface
static SDL_IOStreamInterface.Ptr
static SDL_IOStreamInterface
clone
(Arena arena, SDL_IOStreamInterface src) close()
void
close
(MemorySegment value) final boolean
Indicates whether some other object is "equal to" this one.flush()
void
flush
(MemorySegment value) final int
hashCode()
Returns a hash code value for this object.read()
void
read
(MemorySegment value) seek()
void
seek
(MemorySegment value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.size()
void
size
(MemorySegment value) final String
toString()
Returns a string representation of this record class.int
version()
version
(int value) write()
void
write
(MemorySegment value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$version
-
PATH$size
-
PATH$seek
-
PATH$read
-
PATH$write
-
PATH$flush
-
PATH$close
-
LAYOUT$version
-
LAYOUT$size
-
LAYOUT$seek
-
LAYOUT$read
-
LAYOUT$write
-
LAYOUT$flush
-
LAYOUT$close
-
SIZE$version
public static final long SIZE$version -
SIZE$size
public static final long SIZE$size -
SIZE$seek
public static final long SIZE$seek -
SIZE$read
public static final long SIZE$read -
SIZE$write
public static final long SIZE$write -
SIZE$flush
public static final long SIZE$flush -
SIZE$close
public static final long SIZE$close -
OFFSET$version
public static final long OFFSET$version -
OFFSET$size
public static final long OFFSET$size -
OFFSET$seek
public static final long OFFSET$seek -
OFFSET$read
public static final long OFFSET$read -
OFFSET$write
public static final long OFFSET$write -
OFFSET$flush
public static final long OFFSET$flush -
OFFSET$close
public static final long OFFSET$close
-
-
Constructor Details
-
SDL_IOStreamInterface
Creates an instance of aSDL_IOStreamInterface
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
version
-
version
-
size
-
size
-
size
-
seek
-
seek
-
seek
-
read
-
read
-
read
-
write
-
write
-
write
-
flush
-
flush
-
flush
-
close
-
close
-
close
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
segment
Returns the value of thesegment
record component.
-