![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
Classes | |
| struct | IO |
Public Types | |
| enum class | LifeCycle { OneShot , Trigerred , TriggeredParallel , Daemon } |
| enum class | EmitMode { Null , Line , Chunk , Whole , Json } |
| 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). | |
Public Member Functions | |
| Process (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). | |
| 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. | |
| void | waitForStopped () |
| Block the current thread until the node is stopped. | |
| bool | stopRequested () const noexcept |
| Check if stop has already been called or not. | |
| 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. | |
| InputPort & | inputPort (std::string_view portName) |
| Get an input port by name (mutable). | |
| OutputPort & | outputPort (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. | |
| InputPort & | inputPort (Port::Id id) |
| Get an input port by id (mutable). | |
| OutputPort & | outputPort (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. | |
| 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. | |
| void | setReactor (Runtime::Api::NodeReactor *reactor) |
| Attach the runtime reactor used by this node. | |
| Runtime::Api::NodeReactor * | reactor () const noexcept |
| Get the currently attached reactor (may be null if not set). | |
| FdWatch::Poller & | poller () |
| Access a poller instance associated with this node. | |
| template<typename T = Runtime::Api::NodeTaskExecutor> | |
| T * | customExecutor () const noexcept |
| Access the customer executor of this node if any. | |
Protected Member Functions | |
| void | startImpl () override |
| Called by start before the node is marked running. | |
| void | stopImpl () override |
| Called by stop before the node is marked stopped. | |
| void | initializeImpl (nlohmann::json config) override |
Called by initialize; derived nodes must parse config here. | |
| void | handleMessage (Core::InputPort const &port, Core::MessagePtr message) 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. | |
| void | onNodeStopped () |
| Must be called by classes that re-implement the stopImpl function. | |
| OutputPort & | registerOutputPort (std::string name, MimeType mimeType=MimeType::Any, std::optional< bool > allowsMimeTypePropagation=std::nullopt) |
| Register a data output port. | |
| InputPort & | registerInputPort (std::string name, MimeTypes supportedMimeTypes={}, std::optional< bool > allowsMimeTypePropagation=std::nullopt) |
| Register a data input port. | |
| OutputPort & | registerControlOutputPort (std::string name) |
| Register a control output port. | |
| InputPort & | registerControlInputPort (std::string name) |
| Register a control input port. | |
| void | assignTaskExecutor (Runtime::Api::NodeTaskExecutorPtr executor) |
| Assigns a custom task executor to this node. | |
| void | revokeTaskExecutor () noexcept |
| Revokes a custom task executor, returning this node to the default execution model. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from dfx::Core::Node | |
| static void | validateNodeName (std::string_view name) |
| Validate a node name. | |
|
overrideprotectedvirtual |
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.
| port | The input port that received the message. |
| message | The delivered message. |
Implements dfx::Core::Node.
|
overrideprotectedvirtual |
Called by initialize; derived nodes must parse config here.
Implements dfx::Core::Node.
|
overrideprotectedvirtual |
Called by start before the node is marked running.
Reimplemented from dfx::Core::Node.
|
overrideprotectedvirtual |
Called by stop before the node is marked stopped.
When re-implementing this function, onNodeStopped must be called synchronously or not to inform the system that this node is now stopped.
Reimplemented from dfx::Core::Node.