StructDLiteral<D extends StructD<D, C> , C extends NativeType> 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 allocateInto should simply redirect to writeInto(p.ref).
- Inheritance
- Implementers
Constructors
-
StructDLiteral({Pointer<
C> ? originalPointer})
Properties
- allocKey → String?
-
The RaylibTemp slot key used during the most recent toC allocation.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- internalId → int
-
A stable numeric ID assigned on first toC call for pointer-owning structs.
no setterinherited
- isDisposed → bool
-
Whether markDisposed has been called on this instance.
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
- structName → String
-
The Dart-side type name of this struct
no setterinherited
- tag → String
-
The slot tag used to disambiguate RaylibTemp keys for this instance.
no setterinherited
Methods
-
allocateInto(
RaylibTemp temp, Pointer< C> p, String key) → void -
Writes all fields into the native struct at
p, allocating nested pointers intotempunderkeyas needed.inherited -
allocatePointer(
RaylibTemp temp, String key, [int count = 1]) → Pointer< C> -
Allocates a native slot of
countelements intempunderkeyand returns the resulting pointer.inherited -
clone(
) → D -
Returns a deep copy of this instance, preserving originalPointer.
inherited
-
copy(
) → D -
Returns a deep copy of this instance without originalPointer.
inherited
-
getOriginalPointer(
) → Pointer< C> -
Returns originalPointer, throwing a descriptive StateError if unavailable or this instance isDisposed.
inherited
-
getOriginalPointerAndDispose(
) → Pointer< C> -
Returns originalPointer and immediately calls markDisposed.
inherited
-
markDisposed(
) → void -
Marks this instance as disposed and clears originalPointer.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onOriginalPointer(
void callback(Pointer< C> p)) → void -
Calls
callbackwith originalPointer if it is set, otherwise no-ops.inherited -
setC(
C o) → D -
Copies the fields of the native struct
ointo this instance.inherited -
setD(
D o) → D -
Copies the fields of the Dart struct
ointo this instance.inherited -
setTag(
String newTag) → D -
Sets tag to
newTagand returnsthisfor chaining.inherited -
signature(
) → String -
Returns a human-readable description of this struct's current field values.
inherited
-
syncInto(
RaylibTemp temp, Pointer< C> p, String key) → void -
Syncs Dart-side fields into the already-allocated native pointer
p.inherited -
toC(
RaylibTemp temp, String key) → Pointer< C> -
Returns a native pointer for this struct, allocating or syncing as needed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
writeInto(
C p) → void -
Writes all fields directly into the native struct reference
p. For nested structs, usewriteIntoas well.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited