plugify 1.2.8
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
plugify::Parameters Class Reference

Builder for function parameters to be passed to JIT code. More...

#include <call.hpp>

Public Types

using SlotType = uint64_t
 

Public Member Functions

 Parameters (size_t slotCount)
 Constructor.
 
template<SingleSlotType T>
ParametersAdd (T value)
 Add an argument at the next available position.
 
template<MultiSlotType T>
ParametersAddLarge (const T &value)
 Add a large argument that spans multiple slots.
 
template<typename... Args>
requires (ParameterType<Args> && ...)
ParametersAddMultiple (Args... args)
 Add multiple arguments at once.
 
template<SingleSlotType T>
ParametersSetAt (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 Public Attributes

static constexpr size_t SlotSize = sizeof(SlotType)
 

Detailed Description

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.

Member Typedef Documentation

◆ SlotType

using plugify::Parameters::SlotType = uint64_t

Definition at line 159 of file call.hpp.

Constructor & Destructor Documentation

◆ Parameters()

plugify::Parameters::Parameters ( size_t  slotCount)
inlineexplicit

Constructor.

Parameters
slotCountNumber of parameter slots to allocate.

Definition at line 166 of file call.hpp.

Member Function Documentation

◆ Add()

template<SingleSlotType T>
Parameters & plugify::Parameters::Add ( value)
inline

Add an argument at the next available position.

Template Parameters
TType of the argument.
Parameters
valueValue to add.
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
TType of the argument (must be trivially copyable).
Parameters
valueValue to add.
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
ArgsTypes of the arguments.
Parameters
argsArguments to add.
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
slotsNeededNumber 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,
value 
)
inline

Set argument at specific position (overwrites if exists).

Template Parameters
TType of the argument.
Parameters
indexSlot index.
valueValue to set.
Returns
Reference to this builder for chaining.

Definition at line 219 of file call.hpp.

Member Data Documentation

◆ SlotSize

constexpr size_t plugify::Parameters::SlotSize = sizeof(SlotType)
staticconstexpr

Definition at line 160 of file call.hpp.


The documentation for this class was generated from the following file: