Skip to content

Commit 7012af4

Browse files
authored
v3.19.12
Hide apmon and kafka includes to fix conflicts.
2 parents c0d19aa + ab730ae commit 7012af4

File tree

8 files changed

+29
-7
lines changed

8 files changed

+29
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cmake_policy(VERSION 3.12)
2929

3030
# Define project
3131
project(Monitoring
32-
VERSION 3.19.11
32+
VERSION 3.19.12
3333
DESCRIPTION "O2 Monitoring library"
3434
LANGUAGES CXX
3535
)

src/Backends/ApMonBackend.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <cstdlib>
2525
#include "../MonLogger.h"
2626
#include "../Exceptions/MonitoringException.h"
27+
#include <ApMon.h>
2728

2829
namespace o2
2930
{
@@ -186,6 +187,7 @@ void ApMonBackend::send(std::vector<Metric>&& metrics)
186187
}
187188
}
188189

190+
ApMonBackend::~ApMonBackend() = default;
189191
} // namespace backends
190192
} // namespace monitoring
191193
} // namespace o2

src/Backends/ApMonBackend.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
#define ALICEO2_MONITORING_BACKENDS_APMONBACKEND_H
1919

2020
#include "Monitoring/Backend.h"
21-
#include <ApMon.h>
2221
#include <string>
2322
#include <chrono>
2423
#include <memory>
2524
#include <functional>
2625

26+
// class forward-declaration
27+
// #include <ApMon.h>
28+
// not included here because the header imports some conflicting macros like mem_free
29+
class ApMon;
30+
2731
namespace o2
2832
{
2933
/// ALICE O2 Monitoring system
@@ -47,7 +51,7 @@ class ApMonBackend final : public Backend
4751
ApMonBackend(const std::string& path);
4852

4953
/// Default destructor
50-
~ApMonBackend() = default;
54+
~ApMonBackend(); // not defaulted here
5155

5256
/// Sends multiple metrics not related to each other
5357
/// \@param metrics vector of metrics

src/Transports/KafkaConsumer.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <string>
2020
#include "../MonLogger.h"
2121
#include "../Exceptions/MonitoringException.h"
22+
#include <librdkafka/rdkafkacpp.h>
2223

2324
namespace o2
2425
{

src/Transports/KafkaConsumer.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121

2222
#include <chrono>
2323
#include <string>
24-
#include <librdkafka/rdkafkacpp.h>
24+
25+
// class forward-declaration
26+
// #include <librdkafka/rdkafkacpp.h>
27+
// not included here because the header imports some conflicting macros like mem_free
28+
namespace RdKafka
29+
{
30+
class KafkaConsumer;
31+
}
2532

2633
namespace o2
2734
{

src/Transports/KafkaProducer.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <memory>
1919
#include <string>
2020
#include "../MonLogger.h"
21+
#include <librdkafka/rdkafkacpp.h>
2122

2223
namespace o2
2324
{

src/Transports/KafkaProducer.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121

2222
#include <chrono>
2323
#include <string>
24-
#include <librdkafka/rdkafkacpp.h>
24+
25+
// class forward-declaration
26+
// #include <librdkafka/rdkafkacpp.h>
27+
// not included here because the header imports some conflicting macros like mem_free
28+
namespace RdKafka
29+
{
30+
class Producer;
31+
}
2532

2633
namespace o2
2734
{

test/testMonitoringFactory.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ BOOST_AUTO_TEST_CASE(Noop)
5353
BOOST_AUTO_TEST_CASE(ApMon)
5454
{
5555
std::filesystem::path configPath = std::filesystem::canonical(".");
56-
auto Monitoring = MonitoringFactory::Get("apmon://" + configPath.string() + "/ApMon.conf");
57-
monitoring->send({10, "myCrazyMetric"});
56+
auto m = MonitoringFactory::Get("apmon://" + configPath.string() + "/ApMon.conf");
57+
// m->send({10, "myCrazyMetric"});
5858
}
5959
#endif
6060

0 commit comments

Comments
 (0)