Safir SDK Core
Loading...
Searching...
No Matches
Safir::Utilities::AsioDispatcher Class Reference

The class makes a thread switch and perform a dispatch on Dob connection. More...

#include <Safir/Utilities/AsioDispatcher.h>

Inheritance diagram for Safir::Utilities::AsioDispatcher:
[legend]
Collaboration diagram for Safir::Utilities::AsioDispatcher:
[legend]

Public Member Functions

 AsioDispatcher (const Safir::Dob::Connection &connection, boost::asio::io_context &ioContext)
 Strandless constructor.
 
 AsioDispatcher (const Safir::Dob::Connection &connection, boost::asio::io_context::strand &strand)
 Stranded constructor.
 
 AsioDispatcher (const AsioDispatcher &)=delete
 
AsioDispatcheroperator= (const AsioDispatcher &)=delete
 
boost::asio::io_context::strand & Strand ()
 Get the strand that the dispatcher uses.
 
- Public Member Functions inherited from Safir::Dob::Dispatcher
virtual ~Dispatcher ()
 Virtual destructor is needed since we have virtual member functions.
 
- Public Member Functions inherited from Safir::Dob::Internal::ConsumerBase
virtual ~ConsumerBase ()
 

Detailed Description

The class makes a thread switch and perform a dispatch on Dob connection.

Constructor & Destructor Documentation

◆ AsioDispatcher() [1/3]

Safir::Utilities::AsioDispatcher::AsioDispatcher ( const Safir::Dob::Connection & connection,
boost::asio::io_context & ioContext )

Strandless constructor.

Creates an AsioDispatcher that performs Dispatches using an internal strand. I.e. all Dob callbacks will be performed from within the same - hidden - strand.

If you need access to the strand, use the other constructor.

Parameters
[in]connection- The dob connection.
[in]ioContext- The io_context that runs the main loop

◆ AsioDispatcher() [2/3]

Safir::Utilities::AsioDispatcher::AsioDispatcher ( const Safir::Dob::Connection & connection,
boost::asio::io_context::strand & strand )

Stranded constructor.

Creates an AsioDispatcher that performs Dispatches using a specified strand. I.e. all Dob callbacks will be performed from the given strand.

Parameters
[in]connection- The dob connection.
[in]strand- The strand to dispatch from.

◆ AsioDispatcher() [3/3]

Safir::Utilities::AsioDispatcher::AsioDispatcher ( const AsioDispatcher & )
delete

Member Function Documentation

◆ operator=()

AsioDispatcher & Safir::Utilities::AsioDispatcher::operator= ( const AsioDispatcher & )
delete

◆ Strand()

boost::asio::io_context::strand & Safir::Utilities::AsioDispatcher::Strand ( )

Get the strand that the dispatcher uses.