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 recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final AddressLayoutstatic final AddressLayoutstatic final AddressLayoutstatic final AddressLayoutstatic final AddressLayoutstatic final ValueLayout.OfIntstatic final AddressLayoutstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionSDL_IOStreamInterface(@NotNull MemorySegment segment) Creates an instance of aSDL_IOStreamInterfacerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_IOStreamInterfacestatic SDL_IOStreamInterface.Ptrstatic SDL_IOStreamInterfaceclone(Arena arena, SDL_IOStreamInterface src) close()voidclose(MemorySegment value) final booleanIndicates whether some other object is "equal to" this one.flush()voidflush(MemorySegment value) final inthashCode()Returns a hash code value for this object.read()voidread(MemorySegment value) seek()voidseek(MemorySegment value) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.size()voidsize(MemorySegment value) final StringtoString()Returns a string representation of this record class.intversion()version(int value) write()voidwrite(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_IOStreamInterfacerecord class.- Parameters:
segment- the value for thesegmentrecord 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 thesegmentrecord component.
-