Added to CV_INIT_ALGORITHM a Ptr creation function, for convenience.

Also changed the static functions to inline, to stop GCC complaining
about unused functions.
This commit is contained in:
Roman Donchenko
2013-08-14 12:41:58 +04:00
parent dadee3752c
commit 24dee16b12
5 changed files with 12 additions and 7 deletions

View File

@@ -128,12 +128,17 @@ namespace cv
} //namespace cv
#define CV_INIT_ALGORITHM(classname, algname, memberinit) \
static ::cv::Algorithm* create##classname##_hidden() \
static inline ::cv::Algorithm* create##classname##_hidden() \
{ \
return new classname; \
} \
\
static ::cv::AlgorithmInfo& classname##_info() \
static inline ::cv::Ptr< ::cv::Algorithm> create##classname##_ptr_hidden() \
{ \
return ::cv::makePtr<classname>(); \
} \
\
static inline ::cv::AlgorithmInfo& classname##_info() \
{ \
static ::cv::AlgorithmInfo classname##_info_var(algname, create##classname##_hidden); \
return classname##_info_var; \