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

Classes

struct  Descriptor
 Parsed metadata for an endpoint, used for routing and graph introspection. More...

Public Types

enum class  Location { Local , Remote }
 Logical descriptor of a port endpoint in the dataflow graph. More...

Public Member Functions

 Endpoint (Port &port)
 Construct a local endpoint from an existing port.
 Endpoint (std::string scheme, std::string address, std::string node, std::string port)
 Construct a remote endpoint from manual descriptors.
Location location () const noexcept
 Check if the endpoint is local or remote.
Descriptor const & desc () const noexcept
 Access the descriptor.
Portport () const noexcept
 Return the underlying port if local, otherwise nullptr.
NodePtr node () const noexcept
 Return the owning node pointer if local, otherwise nullptr.
bool isLocal () const noexcept
 Helper to check if location is Location::Local.
bool isRemote () const noexcept
 Helper to check if location is Location::Remote.
std::string toString (bool forceUriFormat=false) const
 Format the endpoint as a string for logging or UI.

Member Enumeration Documentation

◆ Location

enum class dfx::Core::Endpoint::Location
strong

Logical descriptor of a port endpoint in the dataflow graph.

An dfx::Core::Endpoint acts as a bridge between the physical and logical representation of a port. It encapsulates the identity of a connection point, whether it is local (attached to a runtime dfx::Core::Port) or remote (identified via a URI-style descriptor).

Location and Discovery
The class distinguishes between two states:
URI Decomposition
Remote endpoints are defined by a Descriptor, which breaks down URIs like tcp://127.0.0.1:8080/node.port into its constituent parts:

This structure allows graph exporters and runtime components to maintain a coherent graph view even when endpoints exist in separate memory spaces.

Tells where the port associated with this Endpoint is located.

Enumerator
Local 

The associated port is local and accessible to this dfx instance.

Remote 

The associated port is not managed by this dfx instance.

Constructor & Destructor Documentation

◆ Endpoint() [1/2]

dfx::Core::Endpoint::Endpoint ( Port & port)
explicit

Construct a local endpoint from an existing port.

Parameters
portReference to the local port object.

◆ Endpoint() [2/2]

dfx::Core::Endpoint::Endpoint ( std::string scheme,
std::string address,
std::string node,
std::string port )
explicit

Construct a remote endpoint from manual descriptors.

Parameters
schemeTransport protocol identifier.
addressTransport address string.
nodeTarget node name.
portTarget port name.

Member Function Documentation

◆ desc()

Descriptor const & dfx::Core::Endpoint::desc ( ) const
inlinenoexcept

Access the descriptor.

◆ isLocal()

bool dfx::Core::Endpoint::isLocal ( ) const
inlinenoexcept

Helper to check if location is Location::Local.

◆ isRemote()

bool dfx::Core::Endpoint::isRemote ( ) const
inlinenoexcept

Helper to check if location is Location::Remote.

◆ location()

Location dfx::Core::Endpoint::location ( ) const
inlinenoexcept

Check if the endpoint is local or remote.

◆ node()

NodePtr dfx::Core::Endpoint::node ( ) const
noexcept

Return the owning node pointer if local, otherwise nullptr.

◆ port()

Port * dfx::Core::Endpoint::port ( ) const
inlinenoexcept

Return the underlying port if local, otherwise nullptr.

◆ toString()

std::string dfx::Core::Endpoint::toString ( bool forceUriFormat = false) const

Format the endpoint as a string for logging or UI.

URI format is the following: scheme://address/node.port

Parameters
forceUriFormatIf true, outputs as a URI string even for local ports.

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