Open3D (C++ API)  0.18.0+601516a
Task.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <functional>
11 #include <memory>
12 
13 namespace open3d {
14 namespace visualization {
15 namespace gui {
16 
17 class Task {
18 public:
21  Task(std::function<void()> f);
22 
23  Task(const Task&) = delete;
24  Task& operator=(const Task& other) = delete;
25 
27  ~Task();
28 
29  void Run();
30 
31  bool IsFinished() const;
32 
35  void WaitToFinish();
36 
37 private:
38  struct Impl;
39  std::unique_ptr<Impl> impl_;
40 };
41 
42 } // namespace gui
43 } // namespace visualization
44 } // namespace open3d
void Run()
Definition: Task.cpp:41
Task(std::function< void()> f)
Definition: Task.cpp:30
bool IsFinished() const
Definition: Task.cpp:55
void WaitToFinish()
Definition: Task.cpp:67
~Task()
Will call WaitToFinish(), which may block.
Definition: Task.cpp:36
Task & operator=(const Task &other)=delete
Definition: PinholeCameraIntrinsic.cpp:16