Skip to content

Commit 1c1dfd2

Browse files
ktfBarthelemy
authored andcommitted
Fixes for GCC 10.2 (#681)
* Fixes for GCC 10.2 * Update Utility.cxx
1 parent 8f5fb60 commit 1c1dfd2

2 files changed

Lines changed: 29 additions & 22 deletions

File tree

Modules/TPC/include/TPC/Utility.h

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "DataFormatsTPC/ClusterNative.h"
2222
#include "Framework/ProcessingContext.h"
2323

24-
class TCanvas;
24+
#include <TCanvas.h>
2525

2626
namespace o2::quality_control_modules::tpc
2727
{
@@ -32,34 +32,17 @@ namespace o2::quality_control_modules::tpc
3232
/// \param canVec Vector which holds TCanvas pointers persisting for the entire runtime of the task
3333
/// \param canvNames Names of the canvases
3434
/// \param metaData Optional std::map to set meta data for the publishing
35-
auto addAndPublish = [](std::shared_ptr<o2::quality_control::core::ObjectsManager> objectsManager, auto& canVec, std::vector<std::string_view> canvNames, const std::map<std::string, std::string>& metaData = std::map<std::string, std::string>()) {
36-
for (const auto& canvName : canvNames) {
37-
canVec.emplace_back(std::make_unique<TCanvas>(canvName.data()));
38-
auto canvas = canVec.back().get();
39-
objectsManager->startPublishing(canvas);
40-
if (metaData.size() != 0) {
41-
for (const auto& [key, value] : metaData) {
42-
objectsManager->addMetadata(canvas->GetName(), key, value);
43-
}
44-
}
45-
}
46-
};
35+
void addAndPublish(std::shared_ptr<o2::quality_control::core::ObjectsManager> objectsManager, std::vector<std::unique_ptr<TCanvas>>& canVec, std::vector<std::string_view> canvNames, const std::map<std::string, std::string>& metaData = std::map<std::string, std::string>());
4736

4837
/// \brief Converts std::vector<std::unique_ptr<TCanvas>> to std::vector<TCanvas*>
4938
/// \param input std::vector<std::unique_ptr<TCanvas>> to be converted to std::vector<TCanvas*>
5039
/// \return std::vector<TCanvas*>
51-
auto toVector = [](auto& input) {
52-
std::vector<TCanvas*> output;
53-
for (auto& in : input) {
54-
output.emplace_back(in.get());
55-
}
56-
return output;
57-
};
40+
std::vector<TCanvas*> toVector(std::vector<std::unique_ptr<TCanvas>>& input);
5841

5942
/// \brief Converts CLUSTERNATIVE from InputRecord to ClusterNativeAccess
6043
/// Convenience funtion to make native clusters accessible when receiving them from the DPL
6144
/// \param input InputReconrd from the ProcessingContext
6245
/// \return ClusterNativeAccess object for easy cluster access
6346
o2::tpc::ClusterNativeAccess clusterHandler(o2::framework::InputRecord& input);
6447
} //namespace o2::quality_control_modules::tpc
65-
#endif //QUALITYCONTROL_TPCUTILITY_H
48+
#endif //QUALITYCONTROL_TPCUTILITY_H

Modules/TPC/src/Utility.cxx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,30 @@
2828

2929
namespace o2::quality_control_modules::tpc
3030
{
31+
32+
void addAndPublish(std::shared_ptr<o2::quality_control::core::ObjectsManager> objectsManager, std::vector<std::unique_ptr<TCanvas>>& canVec, std::vector<std::string_view> canvNames, const std::map<std::string, std::string>& metaData)
33+
{
34+
for (const auto& canvName : canvNames) {
35+
canVec.emplace_back(std::make_unique<TCanvas>(canvName.data()));
36+
auto canvas = canVec.back().get();
37+
objectsManager->startPublishing(canvas);
38+
if (metaData.size() != 0) {
39+
for (const auto& [key, value] : metaData) {
40+
objectsManager->addMetadata(canvas->GetName(), key, value);
41+
}
42+
}
43+
}
44+
}
45+
46+
std::vector<TCanvas*> toVector(std::vector<std::unique_ptr<TCanvas>>& input)
47+
{
48+
std::vector<TCanvas*> output;
49+
for (auto& in : input) {
50+
output.emplace_back(in.get());
51+
}
52+
return output;
53+
}
54+
3155
o2::tpc::ClusterNativeAccess clusterHandler(o2::framework::InputRecord& input)
3256
{
3357
using namespace o2::tpc;
@@ -99,4 +123,4 @@ o2::tpc::ClusterNativeAccess clusterHandler(o2::framework::InputRecord& input)
99123
return clusterIndex;
100124
}
101125

102-
} // namespace o2::quality_control_modules::tpc
126+
} // namespace o2::quality_control_modules::tpc

0 commit comments

Comments
 (0)