MIRA
Public Member Functions | List of all members
IOService Class Reference

Wrapper class for boost::asio::io_service. More...

#include <communication/IOService.h>

Public Member Functions

 IOService ()
 Creates an I/O service object that creates an own instance of boost::asio::io_service. More...
 
 IOService (boost::asio::io_service &service)
 Creates an I/O service object that uses an existing boost::asio::io_service instance. More...
 
virtual ~IOService ()
 The destructor. More...
 
void runThreads (std::size_t threadCount=0, bool runInThisThread=true)
 Starts a given number of threads on the boost::asio::io_service::run() method. More...
 
std::size_t run ()
 Wrapper for boost::asio::io_service::run() This will block until boost::asio::io_service::run() returns. More...
 
std::size_t runOne ()
 Wrapper for boost::asio::io_service::run_one() More...
 
void stop ()
 Wrapper for boost::asio::io_service::stop() More...
 
void reset ()
 Wrapper for boost::asio::io_service::reset() More...
 
 operator boost::asio::io_service & ()
 Operator for implicit casting to boost::asio::io_service. More...
 
template<typename CompletionHandler >
void post (CompletionHandler handler)
 
void join ()
 Stops and joins all started threads. More...
 

Detailed Description

Wrapper class for boost::asio::io_service.

Constructor & Destructor Documentation

◆ IOService() [1/2]

IOService ( )

Creates an I/O service object that creates an own instance of boost::asio::io_service.

◆ IOService() [2/2]

IOService ( boost::asio::io_service &  service)

Creates an I/O service object that uses an existing boost::asio::io_service instance.

◆ ~IOService()

virtual ~IOService ( )
inlinevirtual

The destructor.

Member Function Documentation

◆ runThreads()

void runThreads ( std::size_t  threadCount = 0,
bool  runInThisThread = true 
)

Starts a given number of threads on the boost::asio::io_service::run() method.

Parameters
[in]threadCountNumber of threads to start.
[in]runInThisThreadIf true this method will call boost::asio::io_service::run() and block until run() returns.

◆ run()

std::size_t run ( )
inline

Wrapper for boost::asio::io_service::run() This will block until boost::asio::io_service::run() returns.

◆ runOne()

std::size_t runOne ( )
inline

Wrapper for boost::asio::io_service::run_one()

◆ stop()

void stop ( )
inline

Wrapper for boost::asio::io_service::stop()

◆ reset()

void reset ( )
inline

Wrapper for boost::asio::io_service::reset()

◆ operator boost::asio::io_service &()

operator boost::asio::io_service & ( )
inline

Operator for implicit casting to boost::asio::io_service.

◆ post()

void post ( CompletionHandler  handler)
inline

◆ join()

void join ( )

Stops and joins all started threads.


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