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 <memory> // std::shared_ptr
5 #include <ostream>
6 #include <string>
7 #include <vector>
8 
9 // OpenPose name and version
13 // #define COMMERCIAL_LICENSE
14 
15 #ifndef _WIN32
16  #define OP_API
17 #elif defined OP_EXPORTS
18  #define OP_API __declspec(dllexport)
19 #else
20  #define OP_API __declspec(dllimport)
21 #endif
22 
23 //Disable some Windows Warnings
24 #ifdef _WIN32
25  #pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
26  #pragma warning( disable: 4275 ) // non dll-interface structXXX used as base
27 #endif
28 
29 #define UNUSED(unusedVariable) (void)(unusedVariable)
30 
31 #define DELETE_COPY(className) \
32  className(const className&) = delete; \
33  className& operator=(const className&) = delete
34 
35 // Instantiate a class with all the basic types
36 #define COMPILE_TEMPLATE_BASIC_TYPES_CLASS(className) COMPILE_TEMPLATE_BASIC_TYPES(className, class)
37 #define COMPILE_TEMPLATE_BASIC_TYPES_STRUCT(className) COMPILE_TEMPLATE_BASIC_TYPES(className, struct)
38 #define COMPILE_TEMPLATE_BASIC_TYPES(className, classType) \
39  template classType OP_API className<char>; \
40  template classType OP_API className<signed char>; \
41  template classType OP_API className<short>; \
42  template classType OP_API className<int>; \
43  template classType OP_API className<long>; \
44  template classType OP_API className<long long>; \
45  template classType OP_API className<unsigned char>; \
46  template classType OP_API className<unsigned short>; \
47  template classType OP_API className<unsigned int>; \
48  template classType OP_API className<unsigned long>; \
49  template classType OP_API className<unsigned long long>; \
50  template classType OP_API className<float>; \
51  template classType OP_API className<double>; \
52  template classType OP_API className<long double>
53 
58 #define OVERLOAD_C_OUT(className) \
59  template<typename T> std::ostream &operator<<(std::ostream& ostream, const op::className<T>& obj) \
60  { \
61  ostream << obj.toString(); \
62  return ostream; \
63  }
64 
65 // Instantiate a class with float and double specifications
66 #define COMPILE_TEMPLATE_FLOATING_TYPES_CLASS(className) COMPILE_TEMPLATE_FLOATING_TYPES(className, class)
67 #define COMPILE_TEMPLATE_FLOATING_TYPES_STRUCT(className) COMPILE_TEMPLATE_FLOATING_TYPES(className, struct)
68 #define COMPILE_TEMPLATE_FLOATING_TYPES(className, classType) \
69  char gInstantiationGuard##className; \
70  template classType OP_API className<float>; \
71  template classType OP_API className<double>
72 
73 // PIMPL does not work if function arguments need the 3rd-party class. Alternative:
74 // stackoverflow.com/questions/13978775/how-to-avoid-include-dependency-to-external-library?answertab=active#tab-top
75 struct dim3;
76 namespace caffe
77 {
78  template <typename T> class Blob;
79 }
80 namespace boost
81 {
82  template <typename T> class shared_ptr; // E.g., boost::shared_ptr<caffe::Blob<float>>
83 }
84 
85 #endif // OPENPOSE_CORE_MACROS_HPP
const std::string OPEN_POSE_VERSION_STRING
Definition: macros.hpp:11
const std::string OPEN_POSE_NAME_AND_VERSION
Definition: macros.hpp:12
Definition: macros.hpp:82
const std::string OPEN_POSE_NAME_STRING
Definition: macros.hpp:10
Definition: macros.hpp:78
std::string string
Definition: cl2.hpp:574