dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
dfx::Node::Testing::Configurable Class Reference
Inheritance diagram for dfx::Node::Testing::Configurable:
[legend]
Collaboration diagram for dfx::Node::Testing::Configurable:
[legend]

Public Member Functions

 Configurable (Id id, std::string name)
Public Member Functions inherited from dfx::Core::Node
 Node (std::string type, Id id, std::string name)
 Construct a node instance.
virtual ~Node ()=0
 Virtual destructor. Pure virtual to ensure Node is abstract, but defined out-of-line.
void setName (std::string newName)
 Rename the node.
template<DerivedFromNode T>
bool is () const noexcept
 Check whether this node is of a given derived type.
template<DerivedFromNode T>
T & as () noexcept
 Cast this node to a derived type (unchecked).
template<DerivedFromNode T>
T const & as () const noexcept
 Cast this node to a derived type (unchecked).
virtual nlohmann::json configSchema () const =0
 Return the JSON schema describing the node configuration. Used by the dfx::Graph::NodeFactory / tooling / UI to validate and edit configuration.
virtual nlohmann::json metadata () const =0
 Return node metadata (description, categories, ports, etc.). Intended for UI/tooling and discovery.
std::string const & type () const noexcept
 Get the node type.
std::string const & name () const noexcept
 Get the node name.
Id id () const noexcept
 Get the node id.
nlohmann::json const & config () const noexcept
 Get the node configuration.
ExecutionFlowPolicy executionFlowPolicy () const noexcept
 Get the node execution policy.
bool isRunning () const noexcept
 Check of the node is currently running.
bool allowsMimeTypePropagation () const noexcept
 Whether this node allows mime-type propagation through its ports.
void start ()
 Start the node.
void stop ()
 Stop the node.
InputPortContainer const & inputPorts () const noexcept
 Get all input ports of all Kind.
OutputPortContainer const & outputPorts () const noexcept
 Get all output ports of all Kind.
bool hasInputPort (std::string_view portName) const noexcept
 Check whether an input port exists by name.
bool hasOutputPort (std::string_view portName) const noexcept
 Check whether an output port exists by name.
bool hasInputPort (Port::Id id) const noexcept
 Check whether an input port exists by id.
bool hasOutputPort (Port::Id id) const noexcept
 Check whether an output port exists by id.
InputPort const & inputPort (std::string_view portName) const
 Get an input port by name.
OutputPort const & outputPort (std::string_view portName) const
 Get an output port by name.
InputPortinputPort (std::string_view portName)
 Get an input port by name (mutable).
OutputPortoutputPort (std::string_view portName)
 Get an output port by name (mutable).
InputPort const & inputPort (Port::Id id) const
 Get an input port by id.
OutputPort const & outputPort (Port::Id id) const
 Get an output port by id.
InputPortinputPort (Port::Id id)
 Get an input port by id (mutable).
OutputPortoutputPort (Port::Id id)
 Get an output port by id (mutable).
void sendMessage (Port::Id id, MessagePtr message)
 Send a message on an output port by id.
void sendMessage (std::string_view portName, MessagePtr message)
 Send a message on an output port by name.
void sendMessage (OutputPort &port, MessagePtr message)
 Send a message on the provided output port.
void lock ()
 Lock the node's internal recursive mutex.
void unlock ()
 Unlock the node's internal recursive mutex.
bool try_lock () noexcept
 Try to lock the node's internal recursive mutex.
void setReactor (Runtime::Api::NodeReactor *reactor)
 Attach the runtime reactor used by this node.
Runtime::Api::NodeReactorreactor () const noexcept
 Get the currently attached reactor (may be null if not set).
FdWatch::Pollerpoller ()
 Access a poller instance associated with this node.

Protected Member Functions

void initializeImpl (nlohmann::json config) override
 Called by initialize; derived nodes must parse config here.
void handleMessage (Core::InputPort const &, Core::MessagePtr) override
 Handle an incoming message on an input port.
Protected Member Functions inherited from dfx::Core::Node
void initialize (nlohmann::json config)
 Initialize the node with its configuration.
void setAllowsMimeTypePropagation (bool allowed)
 Enable/disable global mime-type propagation for this node. This affects how the runtime may propagate mime types through connected ports.
virtual void setExecutionFlowPolicy (ExecutionFlowPolicy policy)
 Set the execution flow policy used by the runtime scheduler.
virtual void startImpl ()
 Called by start before the node is marked running.
virtual void stopImpl ()
 Called by stop before the node is marked stopped.
OutputPortregisterOutputPort (std::string name, MimeType mimeType=MimeType::Any, std::optional< bool > allowsMimeTypePropagation={})
 Register a data output port.
InputPortregisterInputPort (std::string name, MimeTypes supportedMimeTypes={}, std::optional< bool > allowsMimeTypePropagation={})
 Register a data input port.
OutputPortregisterControlOutputPort (std::string name)
 Register a control output port.
InputPortregisterControlInputPort (std::string name)
 Register a control input port.

Additional Inherited Members

Public Types inherited from dfx::Core::Node
enum class  ExecutionFlowPolicy { AlwaysDispatch , InlineIfAvailable }
 Policy controlling how execution is chained after message delivery. More...
using Id = uint32_t
 Node identifier type (unique and stable within a graph instance).
Static Public Member Functions inherited from dfx::Core::Node
static void validateNodeName (std::string_view name)
 Validate a node name.

Member Function Documentation

◆ handleMessage()

void dfx::Node::Testing::Configurable::handleMessage ( Core::InputPort const & port,
Core::MessagePtr message )
inlineoverrideprotectedvirtual

Handle an incoming message on an input port.

This is the core callback invoked by dfx::Core::InputPort when messages are delivered to this node.

Parameters
portThe input port that received the message.
messageThe delivered message.

Implements dfx::Core::Node.

◆ initializeImpl()

void dfx::Node::Testing::Configurable::initializeImpl ( nlohmann::json config)
overrideprotectedvirtual

Called by initialize; derived nodes must parse config here.

Implements dfx::Core::Node.


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