StructDLiteral<C extends Struct, D extends StructD<C, D>> class abstract

A StructD for value-type structs that are always passed by value.

Subclasses never own an originalPointer. toC always allocates a fresh RaylibTemp slot (or reuses) and writes into it. Typical examples are Vector2, Color, Rectangle: small flat structs that raylib accepts and returns by value rather than by pointer.

Implementations of structAllocateInto should simply redirect to writeInto(p.ref).

Inheritance
Implementers

Constructors

StructDLiteral({Pointer<C>? originalPointer})

Properties

$state RaylibTempStructState
Per-instance allocation state tracking slot keys, disposal, and identity.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
originalPointer Pointer<C>?
The C-owned or RaylibTemp-owned native pointer for this struct, if any.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
structIsDisposed bool
Whether structMarkDisposed has been called on this instance.
no setterinherited
structName String
The Dart-side type name of this struct
no setterinherited
structRequiresOriginalPointer bool
Whether this struct requires an originalPointer to function correctly.
no setteroverride

Methods

clone() → D
Returns a deep copy of this instance, preserving RaylibStructBase.originalPointer if present.
inherited
copy() → D
Returns a deep copy of this instance without RaylibStructBase.originalPointer.
inherited
getOriginalPointer() Pointer<C>
Returns originalPointer, throwing a descriptive StateError if unavailable or this instance RaylibTempStructState.isDisposed.
inherited
getOriginalPointerAndDispose() Pointer<C>
Returns originalPointer and immediately calls structMarkDisposed.
inherited
nativeGetIndexedArrayReference(Array<C> p, int index) → C
inherited
nativeGetIndexedReference(Pointer<C> p, int index) → C
inherited
nativeGetReference(Pointer<C> p) → C
inherited
nativeReadFrom(C p) → void
inherited
nativeWriteInto(C p) → void
Writes all fields directly into the native struct reference p. For nested structs, use writeInto as well.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setD(D o) → D
Copies the fields of o into this instance and returns this.
inherited
signature() String
Returns a human-readable representation of this struct's current field values.
inherited
structAllocateInto(RaylibTemp temp, Pointer<C> p, String key) → void
Writes all fields into the native struct at p, allocating nested pointers into temp under key as needed.
inherited
structMarkDisposed() → void
Marks this instance as disposed and clears originalPointer.
inherited
structOnOp(void callback(Pointer<C> p)) → void
Calls callback with originalPointer if it is set, otherwise no-ops.
inherited
structReadFrom(Pointer<C> p) → void
Reads all fields from the memory at p.
inherited
structSetTag(String newTag) → D
Sets RaylibTempStructState.tag to newTag and returns this for chaining.
inherited
structSyncFromMemory() → void
Syncs all fields from the memory. Requires originalPointer.
inherited
structSyncInto(RaylibTemp temp, Pointer<C> p, String key) → void
Syncs Dart-side fields into the already-allocated native pointer p.
inherited
structSyncToMemory() → void
Syncs all fields to the memory. Requires originalPointer.
inherited
structWriteInto(Pointer<C> p) → void
Writes all fields into the memory at p.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited