Franky  0.9.1
A High-Level Motion API for Franka
scope_guard.hpp
Go to the documentation of this file.
1 #include <functional>
2 #include <utility>
3 
4 namespace franky {
5 
9 class scope_guard {
10  public:
16  explicit scope_guard(std::function<void()> f) : f_(std::move(f)) {}
17 
19  f_();
20  }
21 
22  private:
23  std::function<void()> f_;
24 };
25 
26 } // namespace franky
A scope guard that executes a function when it goes out of scope.
Definition: scope_guard.hpp:9
~scope_guard()
Definition: scope_guard.hpp:18
scope_guard(std::function< void()> f)
Constructor that takes a function to execute when the guard goes out of scope.
Definition: scope_guard.hpp:16
Definition: gripper.cpp:3