OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
macros.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_CORE_MACROS_HPP
2 #define OPENPOSE_CORE_MACROS_HPP
3 
4 #include <chrono> // std::chrono:: functionaligy, e.g., std::chrono::milliseconds
5 #include <memory> // std::shared_ptr
6 #include <ostream>
7 #include <string>
8 #include <thread> // std::this_thread
9 #include <vector>
10 
11 // OpenPose name and version
12 const std::string OPEN_POSE_NAME_STRING = "OpenPose";
13 const std::string OPEN_POSE_VERSION_STRING = "1.7.0";
15 // #define COMMERCIAL_LICENSE
16 
17 #ifndef _WIN32
18  #define OP_API
19 #elif defined OP_EXPORTS
20  #define OP_API __declspec(dllexport)
21 #else
22  #define OP_API __declspec(dllimport)
23 #endif
24 
25 // Disable some Windows Warnings
26 #ifdef _WIN32
27  #pragma warning(disable: 4251) // 'XXX': class 'YYY' needs to have dll-interface to be used by clients of class 'ZZZ'
28 #endif
29 
30 #define UNUSED(unusedVariable) (void)(unusedVariable)
31 
32 #define DELETE_COPY(className) \
33  className(const className&) = delete; \
34  className& operator=(const className&) = delete
35 
36 // Instantiate a class with all the basic types
37 #define COMPILE_TEMPLATE_BASIC_TYPES_CLASS(className) COMPILE_TEMPLATE_BASIC_TYPES(className, class)
38 #define COMPILE_TEMPLATE_BASIC_TYPES_STRUCT(className) COMPILE_TEMPLATE_BASIC_TYPES(className, struct)
39 #define COMPILE_TEMPLATE_BASIC_TYPES(className, classType) \
40  template classType OP_API className<char>; \
41  template classType OP_API className<signed char>; \
42  template classType OP_API className<short>; \
43  template classType OP_API className<int>; \
44  template classType OP_API className<long>; \
45  template classType OP_API className<long long>; \
46  template classType OP_API className<unsigned char>; \
47  template classType OP_API className<unsigned short>; \
48  template classType OP_API className<unsigned int>; \
49  template classType OP_API className<unsigned long>; \
50  template classType OP_API className<unsigned long long>; \
51  template classType OP_API className<float>; \
52  template classType OP_API className<double>; \
53  template classType OP_API className<long double>
54 
55 // Instantiate a class with float and double specifications
56 #define COMPILE_TEMPLATE_FLOATING_TYPES_CLASS(className) COMPILE_TEMPLATE_FLOATING_TYPES(className, class)
57 #define COMPILE_TEMPLATE_FLOATING_TYPES_STRUCT(className) COMPILE_TEMPLATE_FLOATING_TYPES(className, struct)
58 #define COMPILE_TEMPLATE_FLOATING_TYPES(className, classType) \
59  char gInstantiationGuard##className; \
60  template classType OP_API className<float>; \
61  template classType OP_API className<double>
62 
63 // Instantiate a class with float and double specifications
64 #define COMPILE_TEMPLATE_FLOATING_INT_TYPES_CLASS(className) COMPILE_TEMPLATE_FLOATING_INT_TYPES(className, class)
65 #define COMPILE_TEMPLATE_FLOATING_INT_TYPES_STRUCT(className) COMPILE_TEMPLATE_FLOATING_INT_TYPES(className, struct)
66 #define COMPILE_TEMPLATE_FLOATING_INT_TYPES(className, classType) \
67  char gInstantiationGuard##className; \
68  template classType OP_API className<int>; \
69  template classType OP_API className<unsigned int>; \
70  template classType OP_API className<float>; \
71  template classType OP_API className<double>
72 
77 #define OVERLOAD_C_OUT(className) \
78  template<typename T> std::ostream &operator<<(std::ostream& ostream, const op::className<T>& obj) \
79  { \
80  ostream << obj.toString(); \
81  return ostream; \
82  }
83 
84 // PIMPL does not work if function arguments need the 3rd-party class. Alternative:
85 // stackoverflow.com/questions/13978775/how-to-avoid-include-dependency-to-external-library?answertab=active#tab-top
86 struct dim3;
87 
88 #endif // OPENPOSE_CORE_MACROS_HPP
const std::string OPEN_POSE_VERSION_STRING
Definition: macros.hpp:13
const std::string OPEN_POSE_NAME_AND_VERSION
Definition: macros.hpp:14
const std::string OPEN_POSE_NAME_STRING
Definition: macros.hpp:12