ie_immediate_executor.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @file ie_immediate_executor.hpp
7  * @brief A header file for Inference Engine Immediate Executor implementation
8  */
9 
10 #pragma once
11 
12 #include <memory>
13 #include <string>
14 
16 
17 namespace InferenceEngine {
18 
19 /**
20  * @brief Task executor implementation that just run tasks in current thread during calling of run() method
21  * @ingroup ie_dev_api_threading
22  */
24 public:
25  /**
26  * @brief A shared pointer to a ImmediateExecutor object
27  */
28  using Ptr = std::shared_ptr<ImmediateExecutor>;
29 
30  /**
31  * @brief Destroys the object.
32  */
33  ~ImmediateExecutor() override = default;
34 
35  void run(Task task) override {
36  task();
37  }
38 };
39 
40 } // namespace InferenceEngine
Interface for Task Executor. Inference Engine uses InferenceEngine::ITaskExecutor interface to run al...
Definition: ie_itask_executor.hpp:46
Task executor implementation that just run tasks in current thread during calling of run() method.
Definition: ie_immediate_executor.hpp:23
~ImmediateExecutor() override=default
Destroys the object.
void run(Task task) override
Execute InferenceEngine::Task inside task executor context.
Definition: ie_immediate_executor.hpp:35
std::shared_ptr< ImmediateExecutor > Ptr
A shared pointer to a ImmediateExecutor object.
Definition: ie_immediate_executor.hpp:28
std::function< void()> Task
Inference Engine Task Executor can use any copyable callable without parameters and output as a task....
Definition: ie_itask_executor.hpp:25
A header file for Inference Engine Task Executor Interface.
Inference Engine Plugin API namespace.