-
-
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) AnythingNOTE: It is the callee's responsibility to ensure
__defer__is called for values that need it. The returnedAnythinghasOwnership::REFERENCE, and so does not handle this.Reads the next item from a variadic array and returns an
Anythingthat references it. -
func getNextType(this *VariadicArray) *AnyTypeReturns the type of the next item in a variadic array. When
variadic_array_use_typeinfoisfalse,nullis returned.
#if !variadic_array_use_typeinfo
-
func getNextType(this *VariadicArray) ptr = nullReturns the type of the next item in a variadic array. When
variadic_array_use_typeinfoisfalse,nullis returned.
-
func hasNext(this *VariadicArray) boolReturns whether another item exists in the variadic array.
-
func reset(this *VariadicArray) voidResets a variadic array to read from the beginning.
-
func read(this *VariadicArray, out item *$T) voidNOTE: 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) StringReads the next value from a variadic array as a
String. -
func readCString(this *VariadicArray) *ubyteReads the next value from a variadic array as a c-string.
-
func readPtr(this *VariadicArray) ptrReads the next value from a variadic array as a pointer.
-
func readBool(this *VariadicArray) boolReads the next value from a variadic array as a
bool. -
func readByte(this *VariadicArray) byteReads the next value from a variadic array as a
byte. -
func readUbyte(this *VariadicArray) ubyteReads the next value from a variadic array as a
ubyte. -
func readShort(this *VariadicArray) shortReads the next value from a variadic array as a
short. -
func readUshort(this *VariadicArray) ushortReads the next value from a variadic array as a
ushort. -
func readInt(this *VariadicArray) intReads the next value from a variadic array as an
int. -
func readUint(this *VariadicArray) uintReads the next value from a variadic array as a
uint. -
func readLong(this *VariadicArray) longReads the next value from a variadic array as a
long. -
func readUlong(this *VariadicArray) ulongReads the next value from a variadic array as a
ulong. -
func readUsize(this *VariadicArray) usizeReads the next value from a variadic array as a
usize. -
func readFloat(this *VariadicArray) floatReads the next value from a variadic array as a
float. -
func readDouble(this *VariadicArray) doubleReads the next value from a variadic array as a
double.
#default variadic_array_sanity_checks true
#default variadic_array_use_typeinfo __typeinfo__