template <typename T>
struct Adaptor
Defined at line 34 of file ../../sdk/lib/zxio/private.h
Public Methods
template <auto fn, typename... Args>
auto From (zxio_t * io, Args... args)
Converts a member function in the implementation C++ class to a signature
compatible with the definition in the ops table.
This class assumes the |zxio_t*| pointer as passed as the first argument to
all |zxio_ops_t| entries is the pointer to the C++ implementation instance.
For example, given the |release| call with the following signature:
zx_status_t (*release)(zxio_t* io, zx_handle_t* out_handle);
The C++ implementation may define a member function with this signature:
zx_status_t MyClass::Release(zx_handle_t* out_handle);
And |Adaptor
<MyClass
>::From
<
&Release
>| will evaluate to a function with a
signature compatible to the C-style definition, treating |io| as a pointer
to the |HasIo|, invoking the corresponding member function automatically.
Defined at line 58 of file ../../sdk/lib/zxio/private.h