Builder for function parameters to be passed to JIT code.
More...
#include <call.hpp>
|
| Parameters (size_t slotCount) |
| Constructor.
|
|
template<SingleSlotType T> |
Parameters & | Add (T value) |
| Add an argument at the next available position.
|
|
template<MultiSlotType T> |
Parameters & | AddLarge (const T &value) |
| Add a large argument that spans multiple slots.
|
|
template<typename... Args>
requires (ParameterType<Args> && ...) |
Parameters & | AddMultiple (Args... args) |
| Add multiple arguments at once.
|
|
template<SingleSlotType T> |
Parameters & | SetAt (size_t index, T value) |
| Set argument at specific position (overwrites if exists).
|
|
const SlotType * | Get () const noexcept |
| Get pointer to the parameter data.
|
|
std::span< const SlotType > | GetSpan () const noexcept |
| Get a span view of the parameters.
|
|
size_t | GetUsedSlots () const noexcept |
| Get the number of slots used.
|
|
size_t | GetCapacity () const noexcept |
| Get the total capacity.
|
|
void | Reset () noexcept |
| Reset the builder to reuse it.
|
|
bool | HasSpace (size_t slotsNeeded=1) const noexcept |
| Check if there's room for more arguments.
|
|
|
static constexpr size_t | SlotSize = sizeof(SlotType) |
|
Builder for function parameters to be passed to JIT code.
Supports various parameter types with automatic slot management.
Definition at line 157 of file call.hpp.
◆ SlotType
using plugify::Parameters::SlotType = uint64_t |
◆ Parameters()
plugify::Parameters::Parameters |
( |
size_t |
slotCount | ) |
|
|
inlineexplicit |
Constructor.
- Parameters
-
slotCount | Number of parameter slots to allocate. |
Definition at line 166 of file call.hpp.
◆ Add()
template<SingleSlotType T>
Add an argument at the next available position.
- Template Parameters
-
- Parameters
-
- Returns
- Reference to this builder for chaining.
Definition at line 177 of file call.hpp.
◆ AddLarge()
template<MultiSlotType T>
Parameters & plugify::Parameters::AddLarge |
( |
const T & |
value | ) |
|
|
inline |
Add a large argument that spans multiple slots.
- Template Parameters
-
T | Type of the argument (must be trivially copyable). |
- Parameters
-
- Returns
- Reference to this builder for chaining.
Definition at line 190 of file call.hpp.
◆ AddMultiple()
template<typename... Args>
requires (ParameterType<Args> && ...)
Parameters & plugify::Parameters::AddMultiple |
( |
Args... |
args | ) |
|
|
inline |
Add multiple arguments at once.
- Template Parameters
-
Args | Types of the arguments. |
- Parameters
-
- Returns
- Reference to this builder for chaining.
Definition at line 206 of file call.hpp.
◆ Get()
const SlotType * plugify::Parameters::Get |
( |
| ) |
const |
|
inlinenoexcept |
Get pointer to the parameter data.
- Returns
- Const pointer to the parameter storage.
Definition at line 230 of file call.hpp.
◆ GetCapacity()
size_t plugify::Parameters::GetCapacity |
( |
| ) |
const |
|
inlinenoexcept |
Get the total capacity.
- Returns
- Total number of slots allocated.
Definition at line 254 of file call.hpp.
◆ GetSpan()
std::span< const SlotType > plugify::Parameters::GetSpan |
( |
| ) |
const |
|
inlinenoexcept |
Get a span view of the parameters.
- Returns
- Span of parameter slots.
Definition at line 238 of file call.hpp.
◆ GetUsedSlots()
size_t plugify::Parameters::GetUsedSlots |
( |
| ) |
const |
|
inlinenoexcept |
Get the number of slots used.
- Returns
- Number of slots currently in use.
Definition at line 246 of file call.hpp.
◆ HasSpace()
bool plugify::Parameters::HasSpace |
( |
size_t |
slotsNeeded = 1 | ) |
const |
|
inlinenoexcept |
Check if there's room for more arguments.
- Parameters
-
slotsNeeded | Number of slots needed (default: 1). |
- Returns
- True if there's enough space.
Definition at line 270 of file call.hpp.
◆ Reset()
void plugify::Parameters::Reset |
( |
| ) |
|
|
inlinenoexcept |
Reset the builder to reuse it.
Definition at line 261 of file call.hpp.
◆ SetAt()
template<SingleSlotType T>
Parameters & plugify::Parameters::SetAt |
( |
size_t |
index, |
|
|
T |
value |
|
) |
| |
|
inline |
Set argument at specific position (overwrites if exists).
- Template Parameters
-
- Parameters
-
index | Slot index. |
value | Value to set. |
- Returns
- Reference to this builder for chaining.
Definition at line 219 of file call.hpp.
◆ SlotSize
constexpr size_t plugify::Parameters::SlotSize = sizeof(SlotType) |
|
staticconstexpr |
The documentation for this class was generated from the following file: