util.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 // clang-format off
6 #define HEBI_DISABLE_COPY_MOVE(Class) \
7 /* Disable copy constructor. */ \
8 Class(const Class& other) = delete; \
9 /* Disable move constructor. */ \
10 Class(Class&& other) = delete; \
11 /* Disable copy assigment operator. */ \
12 Class& operator= (const Class& other) = delete; \
13 /* Disable move assigment operator. */ \
14 Class& operator= (Class&& other) = delete;
15 
16 #define HEBI_DISABLE_COPY(Class) \
17 /* Disable copy constructor. */ \
18 Class(const Class& other) = delete; \
19 /* Disable copy assigment operator. */ \
20 Class& operator= (const Class& other) = delete;
21 // clang-format on
22 
23 namespace hebi {
24 
29 public:
30  explicit FunctionCallResult(bool success) : ok_(success), failure_message_("") {}
31  FunctionCallResult(bool success, const std::string& failure) : ok_(success), failure_message_(failure) {}
34 
35  operator bool() const { return ok_; }
36  bool success() const { return ok_; }
37 
43  const std::string& failureMessage() const { return failure_message_; }
44 private:
45  bool ok_;
46  std::string failure_message_;
47 };
48 
49 }
bool success() const
Definition: util.hpp:36
Definition: arm.cpp:5
FunctionCallResult(bool success)
Definition: util.hpp:30
std::string failure_message_
Definition: util.hpp:46
const std::string & failureMessage() const
Definition: util.hpp:43
Used as a return.
Definition: util.hpp:28
FunctionCallResult(bool success, const std::string &failure)
Definition: util.hpp:31
FunctionCallResult & operator=(FunctionCallResult &&)=default


hebi_cpp_api_ros
Author(s): Chris Bollinger , Matthew Tesch
autogenerated on Thu May 28 2020 03:14:45