Skip to content

Commit 10f85b8

Browse files
author
Michal Tichák
committed
just an idea
1 parent 3bb7634 commit 10f85b8

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

Framework/include/QualityControl/ObjectsManager.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727

2828
class TObject;
2929
class TObjArray;
30+
class TH1;
31+
class TTree;
32+
class THnBase;
33+
class TEfficiency;
34+
class TGraph;
3035

3136
namespace o2::quality_control::core
3237
{
@@ -79,7 +84,19 @@ class ObjectsManager
7984
* @param obj The object to publish.
8085
* @throws DuplicateObjectError
8186
*/
82-
void startPublishing(TObject* obj, PublicationPolicy = PublicationPolicy::Forever);
87+
template <typename T>
88+
void startPublishing(T* obj, PublicationPolicy policy = PublicationPolicy::Forever)
89+
{
90+
if constexpr (!std::is_base_of_v<mergers::MergeInterface, T>() &&
91+
!std::is_base_of_v<TCollection, T>() &&
92+
!std::is_base_of_v<TH1, T>() &&
93+
!std::is_base_of_v<TTree, T>() &&
94+
!std::is_base_of_v<TGraph, T>() &&
95+
!std::is_base_of_v<TEfficiency, T>()) {
96+
static_assert(true, "You are trying to start publish object, that is not mergeable");
97+
}
98+
startPublishingImpl(obj, policy);
99+
}
83100

84101
/**
85102
* Stop publishing this object
@@ -223,6 +240,8 @@ class ObjectsManager
223240
bool mUpdateServiceDiscovery;
224241
Activity mActivity;
225242
std::vector<std::string> mMovingWindowsList;
243+
244+
void startPublishingImpl(TObject* obj, PublicationPolicy);
226245
};
227246

228247
} // namespace o2::quality_control::core

0 commit comments

Comments
 (0)