resource π
Interface to the struct vaccel_resource
C object.
Resource π
Bases: CType
Wrapper for the struct vaccel_resource
C object.
Manages the creation and initialization of a C struct vaccel_resource
and provides access to it through Python properties.
Inherits
CType: Abstract base class for defining C data types.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
| str | Path | The path to the file that will be represented by the resource. | required |
| ResourceType | The type of the resource. | required |
Source code in vaccel/resource.py
value property
π
Returns the value of the underlying C struct.
Returns:
Type | Description |
---|---|
CData | The dereferenced 'struct vaccel_resource` |
is_registered π
is_registered(session: BaseSession) -> bool
Checks if the resource is registered with the session.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
| BaseSession | The session to check for registration. | required |
Returns:
Type | Description |
---|---|
bool | True if the resource is registered with the session. |
Source code in vaccel/resource.py
register π
register(session: BaseSession) -> None
Register the resource with a session.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
| BaseSession | The session to register the resource with. | required |
Source code in vaccel/resource.py
unregister π
unregister(session: BaseSession) -> None
Unregister the resource from a session.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
| BaseSession | The session to unregister the resource from. | required |