Skip to content

Commit 49b27f7

Browse files
committed
fix dispatch
1 parent e7afd47 commit 49b27f7

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

Framework/Core/include/Framework/AnalysisManagers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ template <typename T>
362362
struct ServiceManager<Service<T>> {
363363
static bool add(std::vector<ServiceSpec>& specs, Service<T>&)
364364
{
365-
specs.push_back(CommonAnalysisServices::addAnalysisService<T>());
365+
CommonAnalysisServices::addAnalysisService<T>(specs);
366366
return true;
367367
}
368368

Framework/Core/include/Framework/CommonServices.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include "Framework/ServiceSpec.h"
1515
#include "Framework/TypeIdHelpers.h"
1616

17+
class TDatabasePDG;
18+
1719
namespace o2::framework
1820
{
1921

@@ -73,7 +75,12 @@ struct CommonAnalysisServices {
7375
static ServiceSpec databasePDGSpec();
7476

7577
template <typename T>
76-
static ServiceSpec addAnalysisService();
78+
static void addAnalysisService(std::vector<ServiceSpec>& specs)
79+
{
80+
if constexpr (std::is_same_v<T, TDatabasePDG>) {
81+
specs.push_back(databasePDGSpec());
82+
}
83+
}
7784
};
7885

7986
} // namespace o2::framework

Framework/Core/src/CommonServices.cxx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -542,12 +542,5 @@ o2::framework::ServiceSpec CommonAnalysisServices::databasePDGSpec()
542542
.exit = [](ServiceRegistry&, void* service) { reinterpret_cast<TDatabasePDG*>(service)->Delete(); },
543543
.kind = ServiceKind::Serial};
544544
}
545-
546-
template <>
547-
o2::framework::ServiceSpec CommonAnalysisServices::addAnalysisService<TDatabasePDG>()
548-
{
549-
return databasePDGSpec();
550-
}
551-
552545
} // namespace o2::framework
553546
#pragma GCC diagnostic pop

0 commit comments

Comments
 (0)