OpenPose  1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
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 needs to have dll-interface to be used by clients of class YYY
28  #pragma warning( disable: 4275 ) // non dll-interface structXXX used as base
29 #endif
30 
31 #define UNUSED(unusedVariable) (void)(unusedVariable)
32 
33 #define DELETE_COPY(className) \
34  className(const className&) = delete; \
35  className& operator=(const className&) = delete
36 
37 // Instantiate a class with all the basic types
38 #define COMPILE_TEMPLATE_BASIC_TYPES_CLASS(className) COMPILE_TEMPLATE_BASIC_TYPES(className, class)
39 #define COMPILE_TEMPLATE_BASIC_TYPES_STRUCT(className) COMPILE_TEMPLATE_BASIC_TYPES(className, struct)
40 #define COMPILE_TEMPLATE_BASIC_TYPES(className, classType) \
41  template classType OP_API className<char>; \
42  template classType OP_API className<signed char>; \
43  template classType OP_API className<short>; \
44  template classType OP_API className<int>; \
45  template classType OP_API className<long>; \
46  template classType OP_API className<long long>; \
47  template classType OP_API className<unsigned char>; \
48  template classType OP_API className<unsigned short>; \
49  template classType OP_API className<unsigned int>; \
50  template classType OP_API className<unsigned long>; \
51  template classType OP_API className<unsigned long long>; \
52  template classType OP_API className<float>; \
53  template classType OP_API className<double>; \
54  template classType OP_API className<long double>
55 
60 #define OVERLOAD_C_OUT(className) \
61  template<typename T> std::ostream &operator<<(std::ostream& ostream, const op::className<T>& obj) \
62  { \
63  ostream << obj.toString(); \
64  return ostream; \
65  }
66 
67 // Instantiate a class with float and double specifications
68 #define COMPILE_TEMPLATE_FLOATING_TYPES_CLASS(className) COMPILE_TEMPLATE_FLOATING_TYPES(className, class)
69 #define COMPILE_TEMPLATE_FLOATING_TYPES_STRUCT(className) COMPILE_TEMPLATE_FLOATING_TYPES(className, struct)
70 #define COMPILE_TEMPLATE_FLOATING_TYPES(className, classType) \
71  char gInstantiationGuard##className; \
72  template classType OP_API className<float>; \
73  template classType OP_API className<double>
74 
75 // PIMPL does not work if function arguments need the 3rd-party class. Alternative:
76 // stackoverflow.com/questions/13978775/how-to-avoid-include-dependency-to-external-library?answertab=active#tab-top
77 struct dim3;
78 namespace caffe
79 {
80  template <typename T> class Blob;
81 }
82 namespace boost
83 {
84  template <typename T> class shared_ptr; // E.g., boost::shared_ptr<caffe::Blob<float>>
85 }
86 
87 #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
Definition: macros.hpp:84
const std::string OPEN_POSE_NAME_STRING
Definition: macros.hpp:12
Definition: macros.hpp:80
std::string string
Definition: cl2.hpp:574