dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
CDestinationTransport.hpp
1// SPDX-FileCopyrightText: 2026 Vincent Leroy
2// SPDX-License-Identifier: MIT
3//
4// This file is part of dfx.
5//
6// Licensed under the MIT License. See the LICENSE file in the project root
7// for full license information.
8
9#pragma once
10
11// Project includes
12#include "../../Plugin.hpp"
13#include <dfx-core/transports/destinations/DestinationTransport.hpp>
15
16namespace dfx::Plugins
17{
25{
26public:
31
33
36
37public:
39 void start(FdWatch::Poller & poller) override;
40
42 void stop() noexcept override;
43
44public:
48 bool deliver(Core::MessagePtr message) override;
49
51 int64_t pendingMessageCount() const noexcept override;
52
53private:
54 Plugin const & _plugin;
55 dfx_transport_interface_t _interface{};
56 dfx_transport_handle_t _handle{};
57 dfx_poller_api_t _pluginPoller{};
58};
59} // !namespace dfx::Plugins
Convenience macros to explicitly control copy and move semantics.
#define DFX_DISABLE_COPY_AND_MOVE(ClassName)
Disable both copy and move.
Definition CopyMoveControl.hpp:37
void * dfx_transport_handle_t
Opaque handle representing a transport instance created by the plugin.
Definition PluginInterface.h:66
Abstract base class for all destination transports that deliver messages from a Channel.
Definition DestinationTransport.hpp:26
Definition Endpoint.hpp:24
Endpoint const & endpoint() const noexcept
Gets the endpoint descriptor associated with this transport.
Definition Transport.hpp:161
nlohmann::json const & config() const noexcept
Gets the JSON configuration used to initialize this transport.
Definition Transport.hpp:176
Abstract interface for FD-based event polling.
Definition Poller.hpp:37
void stop() noexcept override
Deactivates the transport.
int64_t pendingMessageCount() const noexcept override
Returns the number of messages queued inside the plugin implementation.
~CDestinationTransport()
Destructor. Calls dfx_transport_interface_t::destroy on the plugin API.
bool deliver(Core::MessagePtr message) override
Packs and delivers a message to the plugin.
void start(FdWatch::Poller &poller) override
Activates the transport and provides the poller vtable to the plugin.
CDestinationTransport(Core::Endpoint endpoint, nlohmann::json config, Plugin const &plugin, dfx_transport_interface_t interface)
Constructs the adaptor and initializes the plugin-side destination.
Manager for a loaded plugin shared library.
Definition Plugin.hpp:38
Definition Channel.hpp:25
Definition MessageApi.hpp:16
Interface to the host's event loop (Poller).
Definition PluginInterface.h:212
The Transport Plugin Interface.
Definition PluginInterface.h:781