Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::kernel::Transport Class Referenceabstract

Interface for implementing a Sen inter-process transport solution. More...

#include <transport.h>

Public Member Functions

 Transport (std::string_view sessionName)
 A transport instance is created per connected session (which is unique within a kernel).
virtual ~Transport ()=default
virtual void start (TransportListener *listener)=0
 Start the message exchange, and set the listener that will react to inputs. This method is non-blocking.
virtual void sendTo (ParticipantAddr &to, BusId &busId, TransportMode mode, MemBlockPtr data)=0
 Send a message over a bus to a participant using a given mode.
virtual void sendTo (ParticipantAddr &to, BusId &busId, TransportMode mode, MemBlockPtr data1, MemBlockPtr data2)=0
 Send a compound message (typically header and data) over a bus to a participant using a given mode.
virtual void localParticipantJoinedBus (ObjectOwnerId participant, BusId bus, const std::string &busName)=0
 Notify other participants that there's a local participant that recently joined a bus.
virtual void localParticipantLeftBus (ObjectOwnerId participant, BusId bus, const std::string &busName)=0
 Notify other participants that there's a local participant that recently left a bus.
virtual const ProcessInfo & getOwnInfo () const noexcept=0
 The process info of this process.
virtual void stop () noexcept=0
 Stop the message exchange.
virtual void stopIO () noexcept
virtual TransportStats fetchStats () const =0
 Fetch the current statistics.
virtual TimerId startTimer (std::chrono::steady_clock::duration timeout, std::function< void()> &&timeoutCallback)=0
 Starts an asio asynchronous timer that executes a callback when the steady_clock timeout is reached.
virtual bool cancelTimer (TimerId id)=0
 Cancels a timer, avoiding its expiration.

Detailed Description

Interface for implementing a Sen inter-process transport solution.

Constructor & Destructor Documentation

◆ Transport()

sen::kernel::Transport::Transport ( std::string_view sessionName)
explicit

A transport instance is created per connected session (which is unique within a kernel).

◆ ~Transport()

virtual sen::kernel::Transport::~Transport ( )
virtualdefault

Member Function Documentation

◆ start()

virtual void sen::kernel::Transport::start ( TransportListener * listener)
pure virtual

Start the message exchange, and set the listener that will react to inputs. This method is non-blocking.

◆ sendTo() [1/2]

virtual void sen::kernel::Transport::sendTo ( ParticipantAddr & to,
BusId & busId,
TransportMode mode,
MemBlockPtr data )
pure virtual

Send a message over a bus to a participant using a given mode.

◆ sendTo() [2/2]

virtual void sen::kernel::Transport::sendTo ( ParticipantAddr & to,
BusId & busId,
TransportMode mode,
MemBlockPtr data1,
MemBlockPtr data2 )
pure virtual

Send a compound message (typically header and data) over a bus to a participant using a given mode.

◆ localParticipantJoinedBus()

virtual void sen::kernel::Transport::localParticipantJoinedBus ( ObjectOwnerId participant,
BusId bus,
const std::string & busName )
pure virtual

Notify other participants that there's a local participant that recently joined a bus.

◆ localParticipantLeftBus()

virtual void sen::kernel::Transport::localParticipantLeftBus ( ObjectOwnerId participant,
BusId bus,
const std::string & busName )
pure virtual

Notify other participants that there's a local participant that recently left a bus.

◆ getOwnInfo()

virtual const ProcessInfo & sen::kernel::Transport::getOwnInfo ( ) const
nodiscardpure virtualnoexcept

The process info of this process.

◆ stop()

virtual void sen::kernel::Transport::stop ( )
pure virtualnoexcept

Stop the message exchange.

◆ stopIO()

virtual void sen::kernel::Transport::stopIO ( )
inlinevirtualnoexcept

◆ fetchStats()

virtual TransportStats sen::kernel::Transport::fetchStats ( ) const
nodiscardpure virtual

Fetch the current statistics.

◆ startTimer()

virtual TimerId sen::kernel::Transport::startTimer ( std::chrono::steady_clock::duration timeout,
std::function< void()> && timeoutCallback )
pure virtual

Starts an asio asynchronous timer that executes a callback when the steady_clock timeout is reached.

◆ cancelTimer()

virtual bool sen::kernel::Transport::cancelTimer ( TimerId id)
pure virtual

Cancels a timer, avoiding its expiration.


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