MeVisLab Toolbox Reference
asio::AsynchronousExecution Class Reference

An asynchronous execution policy. More...

#include <AsynchronousExecution.h>

Inheritance diagram for asio::AsynchronousExecution:
asio::ExecutionPolicy

Public Member Functions

 AsynchronousExecution (std::shared_ptr< Context > context)
void execute (std::function< void()> callable) override
Public Member Functions inherited from asio::ExecutionPolicy
 ExecutionPolicy ()=default
 ExecutionPolicy (const ExecutionPolicy &)=default
ExecutionPolicyoperator= (const ExecutionPolicy &)=default
virtual ~ExecutionPolicy ()=default

Detailed Description

An asynchronous execution policy.

This class implements the asio::ExecutionPolicy interface by scheduling it onto an asio::Context that is run from somewhere else.

Synopsis:

auto context = std::make_shared<asio::Context>();
auto policy = asio::AsynchronousExecution(context);
auto callable = [] {
std::cout << "Hello, world!\n";
};
policy->execute(callable); // callable not executed here
context->run(); // but within this context (context's run method might be invoked somewhere else, also by a different thread)
An asynchronous execution policy.

Definition at line 33 of file AsynchronousExecution.h.

Constructor & Destructor Documentation

◆ AsynchronousExecution()

asio::AsynchronousExecution::AsynchronousExecution ( std::shared_ptr< Context > context)

Member Function Documentation

◆ execute()

void asio::AsynchronousExecution::execute ( std::function< void()> callable)
overridevirtual

Implements asio::ExecutionPolicy.


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