PointerCodec<E, R extends RType> class
A single pointer to one E value.
type is the RPointer<R> describing the pointer field itself; inner decodes whatever the pointer points to.
Two unrelated "array-ish" abilities live here:
-
readArray/writeArray operate on a contiguous array of pointer slots, e.g.
void* xs[8]. -
readAt/writeAt index into the array pointed to by a single pointer, e.g.
T* xs.
- Inheritance
-
- Object
- ElementCodec<
E, RPointer< R> > - PointerCodec
- Mixed-in types
-
- ContiguousCodec<
E, RPointer< R> >
- ContiguousCodec<
Constructors
-
PointerCodec(RPointer<
R> type, ElementCodec<E, R> inner) -
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inner
→ ElementCodec<
E, R> -
Codec for the pointed-to value, applied after dereferencing.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
type
→ RPointer<
R> -
Native type describing the memory region this codec reads and writes.
finalinherited
Methods
-
allocate(
RaylibTemp< RaylibBase> temp, MemoryPointer<RType> p, String key, {int count = 1, bool raw = false}) → void -
Allocates any backing storage for a value at
p, usingtempand identified bykey.countandraware for codecs that allocate arrays or need unmanaged memory.override -
allocator(
RaylibTemp< RaylibBase> temp) → RaylibTempAllocator<RType> ? -
Returns the temp allocator this codec uses to allocate backing storage
out of
temp, ornullif it doesn't allocate.override -
deref<
Y extends RType> (MemoryPointer< RType> p) → MemoryPointer<Y> -
Reads the pointer stored in the slot at
pand returns it, i.e.*p. -
elementPtr(
MemoryPointer< RType> fieldPtr, int index) → MemoryPointer<R> -
Address of element
indexin the array pointed to by this pointer, given the address of the pointer slot (fieldPtr). DereferencesfieldPtrfor you, then delegates to elementPtrFrom. -
elementPtrFrom(
MemoryPointer< RType> derefedBase, int index) → MemoryPointer<R> -
Address of element
index, given a pointer value you've already dereferenced or otherwise resolved (e.g. via pointerElementPtr). -
isValid(
MemoryPointer< RType> p) → bool -
Whether the pointer stored in the slot at
pis non-null. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pointerElementPtr(
MemoryPointer< RType> fieldPtr, int index) → MemoryPointer<R> -
Address stored in pointer slot
index. ForT** p, this isp[index], itself aT*. Intentionally different from elementPtr/elementPtrFrom. -
read(
MemoryPointer< RType> p) → E -
Reads a value of type
Efrom the memory atp.override -
readArray(
MemoryPointer< RType> p, int count) → List<E> -
Reads
countconsecutive values starting atp.override -
readAt(
MemoryPointer< RType> fieldPtr, int index) → E -
Reads element
indexof the array pointed to by the pointer slot atfieldPtr, i.e.fieldPtr->[index]forT* xs. -
readSafe(
MemoryPointer< RType> p, E fallback) → E -
Like read, but returns
fallbackif the pointer stored in the slot atpis null. -
toString(
) → String -
A string representation of this object.
inherited
-
write(
MemoryPointer< RType> p, E value) → void -
Writes
valueto the memory atp.override -
writeArray(
MemoryPointer< RType> p, List<E> values) → void -
Writes
valuesconsecutively starting atp.override -
writeAt(
MemoryPointer< RType> fieldPtr, int index, E value) → E -
Writes
valueto elementindexof the array pointed to by the pointer slot atfieldPtr. -
writeSafe(
MemoryPointer< RType> p, E value) → void -
Like write, but does nothing if the pointer stored in the slot at
pis null.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited