MeVisLab Toolbox Reference
AsynchronousExecution.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 
4 #pragma once
5 
6 #include <asio/System.h>
7 #include <asio/ExecutionPolicy.h>
8 #include <asio/Context.h>
9 #include <asio/Semaphore.h>
10 
11 #include <ThirdPartyWarningsDisable.h>
12 #include <memory>
13 #include <ThirdPartyWarningsRestore.h>
14 
15 namespace asio {
16 
34  {
35  public:
36 
37  AsynchronousExecution(std::shared_ptr<Context> context);
38 
39  void execute(std::function<void()> callable) override;
40 
41  private:
42 
43  std::shared_ptr<Context> _context;
44 
45  Semaphore _semaphore;
46  };
47 
48 }
#define ASYNCHRONOUSIO_EXPORT
Definition: System.h:9
An asynchronous execution policy.
void execute(std::function< void()> callable) override
AsynchronousExecution(std::shared_ptr< Context > context)
Abstract base class for all asio::ExecutionPolicy derivatives.
A simple semaphore with increment and decrement functionality.
Definition: Semaphore.h:40