farm-ng-core
farm_ng::Context Class Reference

Contains the execution state context. More...

#include <context.h>

Public Types

using WorkGuard = boost::asio::io_service::work
 
using IoContext = boost::asio::io_service
 
using Strand = Context::IoContext::strand
 

Public Member Functions

 Context ()
 Default constructor of a context. More...
 
IoContextgetAsioIoContext ()
 Returns a reference to the owned io_context. More...
 
std::shared_ptr< IoContextgetAsioIoContextPtr ()
 Returns a shared pointer to the owned io_context. More...
 
void run ()
 Run the io_context. More...
 
void restartAndRun ()
 
void clearWorkGuard ()
 clear the work for advanced use cases where you want to execute a finite number of tasks, e.g. in tests, or to run the pipeline to completion for a given input. More...
 
void setWorkGuard ()
 Create a new pointer for the worker guard. More...
 

Detailed Description

Contains the execution state context.

Member Typedef Documentation

◆ IoContext

using farm_ng::Context::IoContext = boost::asio::io_service

◆ Strand

using farm_ng::Context::Strand = Context::IoContext::strand

◆ WorkGuard

using farm_ng::Context::WorkGuard = boost::asio::io_service::work

Constructor & Destructor Documentation

◆ Context()

farm_ng::Context::Context ( )

Default constructor of a context.

Member Function Documentation

◆ clearWorkGuard()

void farm_ng::Context::clearWorkGuard ( )

clear the work for advanced use cases where you want to execute a finite number of tasks, e.g. in tests, or to run the pipeline to completion for a given input.

◆ getAsioIoContext()

Context::IoContext & farm_ng::Context::getAsioIoContext ( )

Returns a reference to the owned io_context.

◆ getAsioIoContextPtr()

std::shared_ptr< Context::IoContext > farm_ng::Context::getAsioIoContextPtr ( )

Returns a shared pointer to the owned io_context.

◆ restartAndRun()

void farm_ng::Context::restartAndRun ( )

◆ run()

void farm_ng::Context::run ( )

Run the io_context.

◆ setWorkGuard()

void farm_ng::Context::setWorkGuard ( )

Create a new pointer for the worker guard.


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