Mojo struct
DeviceContextPtrList
@register_passable(trivial)
struct DeviceContextPtrList[size: Int]
A fixed-size collection of DeviceContextPtr objects.
This struct provides a lightweight, register-passable container for a fixed number
of DeviceContextPtr objects, with array-like access semantics.
Parameters
- size (
Int): The fixed number ofDeviceContextPtrobjects in the collection.
Fields
- ptrs (
StaticTuple[DeviceContextPtr, size]): The underlying storage for the device context pointers.
Implemented traits
AnyType,
Copyable,
ImplicitlyCopyable,
Movable,
Sized,
UnknownDestructibility
Aliases
__copyinit__is_trivial
alias __copyinit__is_trivial = True
__del__is_trivial
alias __del__is_trivial = True
__moveinit__is_trivial
alias __moveinit__is_trivial = True
Methods
__init__
__init__(ptrs: StaticTuple[DeviceContextPtr, size]) -> Self
Initialize with a StaticTuple of DeviceContextPtr objects.
Args:
- ptrs (
StaticTuple): A StaticTuple containing theDeviceContextPtrobjects to store.
__getitem__
__getitem__[index: Int](self) -> DeviceContext
Access a DeviceContext at a compile-time known index.
Parameters:
- index (
Int): A compile-time integer index.
Returns:
DeviceContext: The DeviceContext at the specified index.
__getitem__[I: Indexer, //](self, idx: I) -> DeviceContext
Access a DeviceContext using a runtime index value.
Parameters:
- I (
Indexer): A type that conforms to theIndexertrait.
Args:
- idx (
I): A runtime index value that conforms to the Indexer trait.
Returns:
DeviceContext: The DeviceContext at the specified index.
__len__
__len__(self) -> Int
Get the number of DeviceContextPtr objects in the collection.
Returns:
Int: The size of the collection as specified by the size parameter.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!