Skip to content

threadless_task_executor

Dmitry Koplyarov edited this page Aug 24, 2016 · 5 revisions

Back to reference

A task_executor with a public method that processes its task queue.

Defined in wigwag/threadless_task_executor.hpp

template < typename... Policies_ >
class basic_threadless_task_executor : public task_executor
{
public:
	template < typename... Args_ >
	basic_threadless_task_executor(Args_&&... args);

	void process_tasks();

	void add_task(std::function<void()> task);
};

using threadless_task_executor = basic_threadless_task_executor<>;

Table of contents

Template arguments

Policies_...

The custom policies list. You can read more in this tutorial section.

Supported policies:

Constructors

variadic arguments constructor

template < typename... Args_ >
basic_threadless_task_executor(Args_&... args);

Forwards the arguments to the exception_handling policy constructor.

Arguments:

Methods

process_tasks

void process_tasks();

Synchronously executes all the tasks in the queue.

add_task

void add_task(std::function<void()> task);

Puts a task into a queue.

Thread safety: This is a thread-safe method as long as the threading policy assures that.

Arguments:

  • task - an std::function that should be executed in the task_executor

Clone this wiki locally