-
-
Notifications
You must be signed in to change notification settings - Fork 9
VariadicArray
VariadicArray
represents the type of a variadic argument list.
Type | Size | Possible Values | Memory Management Model | File |
---|---|---|---|---|
VariadicArray |
40-48 bytes | Array of arguments | None | 2.7/VariadicArray.adept |
#if !variadic_array_use_typeinfo
struct VariadicArray (items ptr, next ptr, bytes usize, length usize, index usize)
#else
struct VariadicArray (items ptr, next ptr, bytes usize, length usize, index usize, types **AnyType)
#end
Name | Type | Description |
---|---|---|
items |
ptr |
Pointer to raw byte array |
next |
ptr |
Pointer to next element |
bytes |
usize |
Size of items buffer in bytes |
length |
usize |
Number of arguments in items
|
types |
**AnyType |
Type information for each argument |
func __variadic_array__(pointer ptr, bytes usize, length usize, _maybe_types ptr) VariadicArray
VariadicArray
does not perform any memory management.
The items
array points to a byte buffer on the stack, and all memory management of the contained values is up to the consumer of the VariadicArray
.
#if variadic_array_use_typeinfo
-
func read(this *VariadicArray) Anything
NOTE: It is the callee's responsibility to ensure
__defer__
is called for values that need it. The returnedAnything
hasOwnership::REFERENCE
, and so does not handle this.Reads the next item from a variadic array and returns an
Anything
that references it. -
func getNextType(this *VariadicArray) *AnyType
Returns the type of the next item in a variadic array. When
variadic_array_use_typeinfo
isfalse
,null
is returned.
#if !variadic_array_use_typeinfo
-
func getNextType(this *VariadicArray) ptr = null
Returns the type of the next item in a variadic array. When
variadic_array_use_typeinfo
isfalse
,null
is returned.
-
func hasNext(this *VariadicArray) bool
Returns whether another item exists in the variadic array.
-
func reset(this *VariadicArray) void
Resets a variadic array to read from the beginning.
-
func read(this *VariadicArray, out item *$T) void
NOTE: It is the callee's responsibility to ensure
__defer__
is called for values that need itReads the next value from a variadic array.
-
func readString(this *VariadicArray) String
Reads the next value from a variadic array as a
String
. -
func readCString(this *VariadicArray) *ubyte
Reads the next value from a variadic array as a c-string.
-
func readPtr(this *VariadicArray) ptr
Reads the next value from a variadic array as a pointer.
-
func readBool(this *VariadicArray) bool
Reads the next value from a variadic array as a
bool
. -
func readByte(this *VariadicArray) byte
Reads the next value from a variadic array as a
byte
. -
func readUbyte(this *VariadicArray) ubyte
Reads the next value from a variadic array as a
ubyte
. -
func readShort(this *VariadicArray) short
Reads the next value from a variadic array as a
short
. -
func readUshort(this *VariadicArray) ushort
Reads the next value from a variadic array as a
ushort
. -
func readInt(this *VariadicArray) int
Reads the next value from a variadic array as an
int
. -
func readUint(this *VariadicArray) uint
Reads the next value from a variadic array as a
uint
. -
func readLong(this *VariadicArray) long
Reads the next value from a variadic array as a
long
. -
func readUlong(this *VariadicArray) ulong
Reads the next value from a variadic array as a
ulong
. -
func readUsize(this *VariadicArray) usize
Reads the next value from a variadic array as a
usize
. -
func readFloat(this *VariadicArray) float
Reads the next value from a variadic array as a
float
. -
func readDouble(this *VariadicArray) double
Reads the next value from a variadic array as a
double
.
#default variadic_array_sanity_checks true
#default variadic_array_use_typeinfo __typeinfo__