Performance testing: added option to get list of all values for CV_ENUM; added perf test for cv::Sobel

This commit is contained in:
Andrey Kamaev
2011-11-01 15:41:43 +00:00
parent 46262b1972
commit a612fa1520
5 changed files with 77 additions and 4 deletions

View File

@@ -101,6 +101,17 @@ public:\
}\
*os << "UNKNOWN";\
}\
struct Container{\
typedef class_name value_type;\
Container(class_name* first, size_t len): _begin(first), _end(first+len){}\
const class_name* begin() const {return _begin;}\
const class_name* end() const {return _end;}\
private: class_name *_begin, *_end;\
};\
static Container all(){\
static class_name vals[] = {__VA_ARGS__};\
return Container(vals, sizeof(vals)/sizeof(vals[0]));\
}\
private: int _val;\
};\
inline void PrintTo(const class_name& t, std::ostream* os) { t.PrintTo(os); }