|
| 1 | +#ifndef OPENPOSE_UTILITIES_MACROS_HPP |
| 2 | +#define OPENPOSE_UTILITIES_MACROS_HPP |
| 3 | + |
| 4 | +#ifndef _WIN32 |
| 5 | + #define OP_API |
| 6 | +#elif defined OP_EXPORTS |
| 7 | + #define OP_API __declspec(dllexport) |
| 8 | +#else |
| 9 | + #define OP_API __declspec(dllimport) |
| 10 | +#endif |
| 11 | + |
| 12 | +#define DATUM_BASE_NO_PTR std::vector<Datum> |
| 13 | +#define DATUM_BASE std::shared_ptr<DATUM_BASE_NO_PTR> |
| 14 | +#define DEFINE_TEMPLATE_DATUM(templateName) template class OP_API templateName<DATUM_BASE> |
| 15 | +#define COMPILE_TEMPLATE_DATUM(templateName) extern DEFINE_TEMPLATE_DATUM(templateName) |
| 16 | + |
| 17 | +#define UNUSED(unusedVariable) (void)(unusedVariable) |
| 18 | + |
| 19 | +#define DELETE_COPY(className) \ |
| 20 | + className(const className&) = delete; \ |
| 21 | + className& operator=(const className&) = delete |
| 22 | + |
| 23 | +#define COMPILE_TEMPLATE_BASIC_TYPES_CLASS(className) COMPILE_TEMPLATE_BASIC_TYPES(className, class) |
| 24 | + |
| 25 | +#define COMPILE_TEMPLATE_BASIC_TYPES_STRUCT(className) COMPILE_TEMPLATE_BASIC_TYPES(className, struct) |
| 26 | + |
| 27 | +#define COMPILE_TEMPLATE_BASIC_TYPES(className, classType) \ |
| 28 | + template classType OP_API className<char>; \ |
| 29 | + template classType OP_API className<signed char>; \ |
| 30 | + template classType OP_API className<short>; \ |
| 31 | + template classType OP_API className<int>; \ |
| 32 | + template classType OP_API className<long>; \ |
| 33 | + template classType OP_API className<long long>; \ |
| 34 | + template classType OP_API className<unsigned char>; \ |
| 35 | + template classType OP_API className<unsigned short>; \ |
| 36 | + template classType OP_API className<unsigned int>; \ |
| 37 | + template classType OP_API className<unsigned long>; \ |
| 38 | + template classType OP_API className<unsigned long long>; \ |
| 39 | + template classType OP_API className<float>; \ |
| 40 | + template classType OP_API className<double>; \ |
| 41 | + template classType OP_API className<long double> |
| 42 | + |
| 43 | +// Includes at the end, since this macros class does not need them, but the files that call this |
| 44 | +// file. However, keeping the files at the beginning might create a circular include linking problem. |
| 45 | +#include <memory> // std::shared_ptr |
| 46 | +#include <vector> |
| 47 | +#include <openpose/core/datum.hpp> |
| 48 | +#include <openpose/core/point.hpp> |
| 49 | +#include <openpose/core/rectangle.hpp> |
| 50 | +#include <openpose/core/macros.hpp> |
| 51 | + |
| 52 | +#endif // OPENPOSE_UTILITIES_MACROS_HPP |
0 commit comments