arg ๐
Interface to the struct vaccel_arg C object.
Arg ๐
Arg(data: Any, type_: ArgType = RAW, custom_type_id: int = 0)
Bases: CType
Wrapper for the vaccel_arg C struct.
Manages the creation and initialization of a C struct vaccel_arg object and provides access to it through Python properties.
Inherits
CType: Abstract base class for defining C data types.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| Any | The input data to be passed to the C struct. | required |
| ArgType | The type of the arg. | RAW |
| int | The user-specified type ID of the arg if the type is | 0 |
Source code in vaccel/arg.py
buf property ๐
buf: Any
Returns the buffer value from the underlying C struct.
Retrieves the buffer (buf) stored in the struct vaccel_arg C object. If the original data type is a Python built-in type, the buffer is converted back to that type.
Returns:
| Type | Description |
|---|---|
Any | The buffer value from the C |
type property ๐
The arg type.
Returns:
| Type | Description |
|---|---|
ArgType | The type of the arg. |
value property ๐
Returns the value of the underlying C struct.
Returns:
| Type | Description |
|---|---|
CData | The dereferenced 'struct vaccel_arg` |
ArgTypeMapper ๐
Utility for mapping between ArgType and other common types.
is_numeric classmethod ๐
type_to_c_type classmethod ๐
Converts an ArgType to a C type string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| ArgType | The arg type value. | required |
Returns:
| Type | Description |
|---|---|
str | A corresponding C type as a string (e.g., "float", "int64_t"). |
Raises:
| Type | Description |
|---|---|
ValueError | If the |