HydroCouple  2.0.0-alpha.1
HydroCouple Interface Definitions
Loading...
Searching...
No Matches
HydroCouple::Distributed::ITransport Class Referenceabstract

ITransport is a transport-neutral, tagged message channel between processes. More...

#include <hydrocoupledistributed.h>

Inheritance diagram for HydroCouple::Distributed::ITransport:
Collaboration diagram for HydroCouple::Distributed::ITransport:

Classes

struct  Endpoint
 Endpoint identifies one participant reachable through this transport. More...
 

Public Member Functions

virtual ~ITransport ()=default
 ITransport::~ITransport is a virtual destructor.
 
virtual Endpoint localEndpoint () const =0
 The endpoint of the calling process on this transport.
 
virtual int32_t participantCount () const =0
 The number of participants reachable through this transport.
 
virtual bool send (const Endpoint &to, int32_t tag, const BufferDescriptor &payload, std::string *message=nullptr)=0
 Sends a typed payload to a peer, blocking until the payload buffer is reusable.
 
virtual bool receive (const Endpoint &from, int32_t tag, const BufferDescriptor &into, std::string *message=nullptr)=0
 Receives a typed payload from a peer, blocking until it arrives.
 
virtual std::unique_ptr< IExchangeRequestsendAsync (const Endpoint &to, int32_t tag, const BufferDescriptor &payload)=0
 Nonblocking send; the payload buffer must remain valid until the request completes.
 
virtual std::unique_ptr< IExchangeRequestreceiveAsync (const Endpoint &from, int32_t tag, const BufferDescriptor &into)=0
 Nonblocking receive; the destination buffer must remain valid until the request completes.
 
- Public Member Functions inherited from HydroCouple::IIdentity
virtual ~IIdentity ()=default
 IIdentity::~IIdentity is a virtual destructor.
 
virtual const std::string & id () const =0
 Gets a unique identifier for the entity.
 
- Public Member Functions inherited from HydroCouple::IDescription
virtual ~IDescription ()=default
 IDescription::~IDescription is a virtual destructor.
 
virtual const std::string & caption () const =0
 Gets caption for the entity.
 
virtual void setCaption (const std::string &caption)=0
 Sets caption for the entity.
 
virtual const std::string & description () const =0
 Gets additional descriptive information for the entity.
 
virtual void setDescription (const std::string &description)=0
 Gets additional descriptive information for the entity.
 
- Public Member Functions inherited from HydroCouple::IPropertyChanged
virtual ~IPropertyChanged ()=default
 IPropertyChanged::~IPropertyChanged is a virtual destructor.
 
- Public Member Functions inherited from HydroCouple::ISignal< std::string >
virtual ~ISignal ()=default
 ISignal::~ISignal is a virtual destructor.
 
virtual void connect (const std::shared_ptr< ISlot< Args... > > &slot)=0
 connect is used to connect a slot to the signal.
 
virtual void disconnect (const std::shared_ptr< ISlot< Args... > > &slot)=0
 disconnect is used to disconnect a slot from the signal.
 
virtual void blockSignals (bool block)=0
 blockSignals is used to block signals from being emitted.
 

Additional Inherited Members

- Protected Member Functions inherited from HydroCouple::ISignal< std::string >
virtual void emit (Args... args)=0
 emit is used to emit the signal.
 

Detailed Description

ITransport is a transport-neutral, tagged message channel between processes.

Implementations are provided by SDKs: an MPI transport (built on communicators/inter-communicators), an in-process transport (for testing distributed compositions without a launcher), or socket-based transports for cloud execution. Payloads are always typed BufferDescriptor views, so the bytes on the wire have the same layout discipline as the bytes in memory.

Threading contract: send/receive and their asynchronous variants are safe to call from multiple threads; message ordering is guaranteed only between a fixed (sender, receiver, tag) triple.

Constructor & Destructor Documentation

◆ ~ITransport()

virtual HydroCouple::Distributed::ITransport::~ITransport ( )
virtualdefault

ITransport::~ITransport is a virtual destructor.

Member Function Documentation

◆ localEndpoint()

virtual Endpoint HydroCouple::Distributed::ITransport::localEndpoint ( ) const
nodiscardpure virtual

The endpoint of the calling process on this transport.

Returns
The local Endpoint.

◆ participantCount()

virtual int32_t HydroCouple::Distributed::ITransport::participantCount ( ) const
nodiscardpure virtual

The number of participants reachable through this transport.

Returns
The participant count.

◆ receive()

virtual bool HydroCouple::Distributed::ITransport::receive ( const Endpoint & from,
int32_t tag,
const BufferDescriptor & into,
std::string * message = nullptr )
nodiscardpure virtual

Receives a typed payload from a peer, blocking until it arrives.

Parameters
[in]fromis the source endpoint.
[in]tagis the message stream tag to match.
[in]intodescribes the pre-allocated buffer receiving the payload.
[out]messageoptionally receives a failure description.
Returns
True on success.

◆ receiveAsync()

virtual std::unique_ptr< IExchangeRequest > HydroCouple::Distributed::ITransport::receiveAsync ( const Endpoint & from,
int32_t tag,
const BufferDescriptor & into )
nodiscardpure virtual

Nonblocking receive; the destination buffer must remain valid until the request completes.

Parameters
[in]fromis the source endpoint.
[in]tagis the message stream tag to match.
[in]intodescribes the pre-allocated buffer receiving the payload.
Returns
A request handle; never nullptr.

◆ send()

virtual bool HydroCouple::Distributed::ITransport::send ( const Endpoint & to,
int32_t tag,
const BufferDescriptor & payload,
std::string * message = nullptr )
nodiscardpure virtual

Sends a typed payload to a peer, blocking until the payload buffer is reusable.

Parameters
[in]tois the destination endpoint.
[in]tagdisambiguates concurrent message streams between the same pair of endpoints.
[in]payloaddescribes the bytes to send.
[out]messageoptionally receives a failure description.
Returns
True on success.

◆ sendAsync()

virtual std::unique_ptr< IExchangeRequest > HydroCouple::Distributed::ITransport::sendAsync ( const Endpoint & to,
int32_t tag,
const BufferDescriptor & payload )
nodiscardpure virtual

Nonblocking send; the payload buffer must remain valid until the request completes.

Parameters
[in]tois the destination endpoint.
[in]tagdisambiguates concurrent message streams between the same pair of endpoints.
[in]payloaddescribes the bytes to send.
Returns
A request handle; never nullptr.

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