dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
dfx::Plugins::MessageApi Class Reference

Static utility for bridging native C++ Messages and the C-ABI Message API. More...

#include <dfx-plugins/api/MessageApi.hpp>

Static Public Member Functions

static dfx_message_api_t buildMessageApi (Core::Message &message)
 Constructs a C-compatible API structure for a native message.
static Core::MessagemessageFromHandle (dfx_message_handle_t handle)
 Recovers a native C++ Message pointer from an opaque C handle.

Detailed Description

Static utility for bridging native C++ Messages and the C-ABI Message API.

This class provides factory and conversion methods to facilitate the interaction between the C++ core and C plugins. It is responsible for populating the dfx_message_api_t vtable with host-side implementations that interrogate native Core::Message objects.

Member Function Documentation

◆ buildMessageApi()

dfx_message_api_t dfx::Plugins::MessageApi::buildMessageApi ( Core::Message & message)
static

Constructs a C-compatible API structure for a native message.

This method populates a dfx_message_api_t structure with function pointers that wrap the provided message. The resulting structure can then be passed to a plugin (e.g., via dfx_node_interface_t::on_message).

Parameters
messageThe native C++ message to be interrogated by the C-ABI.
Returns
A fully initialized vtable for message interrogation.

◆ messageFromHandle()

Core::Message * dfx::Plugins::MessageApi::messageFromHandle ( dfx_message_handle_t handle)
static

Recovers a native C++ Message pointer from an opaque C handle.

Parameters
handleThe opaque handle received from the C-ABI.
Returns
A pointer to the underlying native Message object.

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