LLVM 24.0.0git
llvm::orc::ConnectionSpec Class Reference

The parsed form of a string describing one connection a process should establish with its peer: More...

#include "llvm/ExecutionEngine/Orc/Shared/ConnectionSpec.h"

Public Member Functions

StringRef getTransport () const
 The transport name, e.g. "tcp". Never empty.
StringRef getAction () const
 The action name, e.g. "connect" or "adopt". May be empty.
StringRef getDescriptor () const
 The thing the transport names, in whatever syntax that transport defines.
std::string str () const
 Rebuilds the original connection string, e.g. "tcp:connect=host:port".

Static Public Member Functions

static LLVM_ABI Expected< ConnectionSpec > parse (StringRef Spec)
 Parses Spec as <transport>[:<action>]=<descriptor>.

Detailed Description

The parsed form of a string describing one connection a process should establish with its peer:

<transport>[:<action>]=<descriptor>

transport what kind of thing the descriptor names: "tcp" for a host:port endpoint, "socket" for a handle this process already holds. action what this process does with it: "connect", "listen", or "adopt" for a handle it was handed. descriptor the thing itself, in whatever syntax the transport defines.

E.g. "tcp:connect=localhost:20000", "tcp:listen=[::1]:0", "socket:adopt=3".

A spec says what the process reading it does, so the two ends of one connection carry different specs: an executor told "tcp:connect=<host>:<port>" pairs with a controller told "tcp:listen=:0".

Parsing checks punctuation only: transport and action are opaque tokens, the descriptor's syntax belongs to the transport, and all three fields are kept verbatim – so a caller matching a name against a known set does so case-sensitively. Only the text before the first '=' is searched for the ':', which lets a descriptor hold ':' and '=' unescaped.

Definition at line 46 of file ConnectionSpec.h.

Member Function Documentation

◆ getAction()

StringRef llvm::orc::ConnectionSpec::getAction ( ) const
inline

The action name, e.g. "connect" or "adopt". May be empty.

Definition at line 55 of file ConnectionSpec.h.

◆ getDescriptor()

StringRef llvm::orc::ConnectionSpec::getDescriptor ( ) const
inline

The thing the transport names, in whatever syntax that transport defines.

Opaque here: the parser neither splits nor validates it. May be empty.

Definition at line 59 of file ConnectionSpec.h.

◆ getTransport()

StringRef llvm::orc::ConnectionSpec::getTransport ( ) const
inline

The transport name, e.g. "tcp". Never empty.

Definition at line 52 of file ConnectionSpec.h.

◆ parse()

Expected< ConnectionSpec > ConnectionSpec::parse ( StringRef Spec)
static

Parses Spec as <transport>[:<action>]=<descriptor>.

Definition at line 20 of file ConnectionSpec.cpp.

References makeConnectionSpecError().

◆ str()

std::string llvm::orc::ConnectionSpec::str ( ) const
inline

Rebuilds the original connection string, e.g. "tcp:connect=host:port".

Definition at line 62 of file ConnectionSpec.h.


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