Class PackedArgs#

Class Documentation#

class PackedArgs#

Represents arguments packed in AnyView array.

Note

This class represent packed arguments to ffi::Function

Public Functions

inline PackedArgs(const AnyView *data, int32_t size)#

Constructor.

Parameters:
  • data – The arguments

  • size – The number of arguments

inline int size() const#
Returns:

size of the arguments

inline const AnyView *data() const#
Returns:

The arguments

inline PackedArgs Slice(int begin, int end = -1) const#

Slice the arguments.

Parameters:
  • begin – The begin index

  • end – The end index

Returns:

The sliced arguments

Public Static Functions

template<typename ...Args>
static inline void Fill(AnyView *data, Args&&... args)#

Fill the arguments into the AnyView array.

Note

Caller must ensure all args are alive during lifetime of data. A common pitfall is to pass in local variables that are immediately destroyed after calling Fill.

Parameters:
  • data – The AnyView array to store the packed arguments

  • args – The arguments to be packed