@@ -1447,6 +1447,7 @@ class Fixture : public internal::Benchmark {
14471447 std::filesystem::relative (__FILE__, CODSPEED_GIT_ROOT_DIR).string() + "::"
14481448#define NAMESPACE \
14491449 (([]() { return extract_lambda_namespace (__PRETTY_FUNCTION__); })())
1450+ #define STATIC_NAMESPACE_STRING (name ) static std::string name = NAMESPACE;
14501451
14511452#define FILE_AND_NAMESPACE CUR_FILE + NAMESPACE
14521453
@@ -1581,6 +1582,62 @@ class Fixture : public internal::Benchmark {
15811582 [](::benchmark::State& st) { func<a, b>(st, __VA_ARGS__); })))
15821583#endif
15831584
1585+ #ifdef CODSPEED_ENABLED
1586+
1587+ #define BENCHMARK_PRIVATE_DECLARE_F (BaseClass, Method ) \
1588+ STATIC_NAMESPACE_STRING (ns_##BaseClass##_##Method); \
1589+ class BaseClass ##_##Method##_Benchmark : public BaseClass { \
1590+ public: \
1591+ BaseClass##_##Method##_Benchmark() { \
1592+ this ->SetName (CUR_FILE + ns_##BaseClass##_##Method + \
1593+ #Method " [" #BaseClass " ]" ); \
1594+ } \
1595+ \
1596+ protected: \
1597+ void BenchmarkCase (::benchmark::State&) override ; \
1598+ };
1599+
1600+ #define BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F (BaseClass, Method, a ) \
1601+ STATIC_NAMESPACE_STRING (ns_##BaseClass##_##Method); \
1602+ class BaseClass ##_##Method##_Benchmark : public BaseClass<a> { \
1603+ public: \
1604+ BaseClass##_##Method##_Benchmark() { \
1605+ this ->SetName (CUR_FILE + ns_##BaseClass##_##Method + \
1606+ #Method " [" #BaseClass " , " #a " ]" ); \
1607+ } \
1608+ \
1609+ protected: \
1610+ void BenchmarkCase (::benchmark::State&) override ; \
1611+ };
1612+
1613+ #define BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F (BaseClass, Method, a, b ) \
1614+ STATIC_NAMESPACE_STRING (ns_##BaseClass##_##Method); \
1615+ class BaseClass ##_##Method##_Benchmark : public BaseClass<a, b> { \
1616+ public: \
1617+ BaseClass##_##Method##_Benchmark() { \
1618+ this ->SetName (CUR_FILE + ns_##BaseClass##_##Method + \
1619+ #Method " [" #BaseClass " , " #a " , " #b " ]" ); \
1620+ } \
1621+ \
1622+ protected: \
1623+ void BenchmarkCase (::benchmark::State&) override ; \
1624+ };
1625+
1626+ #define BENCHMARK_TEMPLATE_PRIVATE_DECLARE_F (BaseClass, Method, ...) \
1627+ STATIC_NAMESPACE_STRING (ns_##BaseClass##_##Method); \
1628+ class BaseClass ##_##Method##_Benchmark : public BaseClass<__VA_ARGS__> { \
1629+ public: \
1630+ BaseClass##_##Method##_Benchmark() { \
1631+ this ->SetName (CUR_FILE + ns_##BaseClass##_##Method + \
1632+ #Method " [" #BaseClass " , " #__VA_ARGS__ " ]" ); \
1633+ } \
1634+ \
1635+ protected: \
1636+ void BenchmarkCase (::benchmark::State&) override ; \
1637+ };
1638+
1639+ #else // CODSPEED_ENABLED undefined:
1640+
15841641#define BENCHMARK_PRIVATE_DECLARE_F (BaseClass, Method ) \
15851642 class BaseClass ##_##Method##_Benchmark : public BaseClass { \
15861643 public: \
@@ -1602,7 +1659,6 @@ class Fixture : public internal::Benchmark {
16021659 protected: \
16031660 void BenchmarkCase (::benchmark::State&) override ; \
16041661 };
1605-
16061662#define BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F (BaseClass, Method, a, b ) \
16071663 class BaseClass ##_##Method##_Benchmark : public BaseClass<a, b> { \
16081664 public: \
@@ -1624,6 +1680,7 @@ class Fixture : public internal::Benchmark {
16241680 protected: \
16251681 void BenchmarkCase (::benchmark::State&) override ; \
16261682 };
1683+ #endif
16271684
16281685#define BENCHMARK_DEFINE_F (BaseClass, Method ) \
16291686 BENCHMARK_PRIVATE_DECLARE_F (BaseClass, Method) \
0 commit comments