Skip to content

Commit 01c8087

Browse files
Fix false positive memleak detection
1 parent 63c0ffc commit 01c8087

4 files changed

Lines changed: 12 additions & 35 deletions

File tree

modules/mqtt_streaming_module/include/mqtt_streaming_module/handler_base.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <mqtt_streaming_module/types.h>
2222
#include <opendaq/sample_type_traits.h>
2323
#include <vector>
24+
#include <set>
2425

2526
BEGIN_NAMESPACE_OPENDAQ_MQTT_STREAMING_MODULE
2627

@@ -173,6 +174,17 @@ class HandlerBase
173174
}
174175
return valueFieldName;
175176
}
177+
178+
inline static const std::set<SampleType> allowedSampleTypes{SampleType::Float64,
179+
SampleType::Float32,
180+
SampleType::UInt8,
181+
SampleType::Int8,
182+
SampleType::UInt16,
183+
SampleType::Int16,
184+
SampleType::UInt32,
185+
SampleType::Int32,
186+
SampleType::UInt64,
187+
SampleType::Int64};
176188
};
177189

178190
END_NAMESPACE_OPENDAQ_MQTT_STREAMING_MODULE

modules/mqtt_streaming_module/src/atomic_signal_atomic_sample_handler.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <opendaq/event_packet_params.h>
55
#include <opendaq/event_packet_ptr.h>
66
#include <opendaq/sample_type_traits.h>
7-
#include <set>
87

98
BEGIN_NAMESPACE_OPENDAQ_MQTT_STREAMING_MODULE
109

@@ -26,16 +25,6 @@ MqttData AtomicSignalAtomicSampleHandler::processSignalContexts(std::vector<Sign
2625

2726
ProcedureStatus AtomicSignalAtomicSampleHandler::validateSignalContexts(const std::vector<SignalContext>& signalContexts) const
2827
{
29-
static const std::set<SampleType> allowedSampleTypes{SampleType::Float64,
30-
SampleType::Float32,
31-
SampleType::UInt8,
32-
SampleType::Int8,
33-
SampleType::UInt16,
34-
SampleType::Int16,
35-
SampleType::UInt32,
36-
SampleType::Int32,
37-
SampleType::UInt64,
38-
SampleType::Int64};
3928
ProcedureStatus status{true, {}};
4029
for (const auto& sigCtx : signalContexts)
4130
{

modules/mqtt_streaming_module/src/group_signal_shared_ts_handler.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <opendaq/reader_utils.h>
88
#include <opendaq/sample_type_traits.h>
99
#include <optional>
10-
#include <set>
1110

1211
BEGIN_NAMESPACE_OPENDAQ_MQTT_STREAMING_MODULE
1312

@@ -64,17 +63,6 @@ MqttData GroupSignalSharedTsHandler::processSignalContexts(std::vector<SignalCon
6463

6564
ProcedureStatus GroupSignalSharedTsHandler::validateSignalContexts(const std::vector<SignalContext>& signalContexts) const
6665
{
67-
68-
static const std::set<SampleType> allowedSampleTypes{SampleType::Float64,
69-
SampleType::Float32,
70-
SampleType::UInt8,
71-
SampleType::Int8,
72-
SampleType::UInt16,
73-
SampleType::Int16,
74-
SampleType::UInt32,
75-
SampleType::Int32,
76-
SampleType::UInt64,
77-
SampleType::Int64};
7866
ProcedureStatus status{true, {}};
7967
for (const auto& sigCtx : signalContexts)
8068
{

modules/mqtt_streaming_module/src/signal_arr_atomic_sample_handler.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <opendaq/reader_factory.h>
77
#include <opendaq/reader_utils.h>
88
#include <opendaq/sample_type_traits.h>
9-
#include <set>
109

1110
BEGIN_NAMESPACE_OPENDAQ_MQTT_STREAMING_MODULE
1211

@@ -57,17 +56,6 @@ MqttData SignalArrayAtomicSampleHandler::processSignalContexts(std::vector<Signa
5756

5857
ProcedureStatus SignalArrayAtomicSampleHandler::validateSignalContexts(const std::vector<SignalContext>& signalContexts) const
5958
{
60-
61-
static const std::set<SampleType> allowedSampleTypes{SampleType::Float64,
62-
SampleType::Float32,
63-
SampleType::UInt8,
64-
SampleType::Int8,
65-
SampleType::UInt16,
66-
SampleType::Int16,
67-
SampleType::UInt32,
68-
SampleType::Int32,
69-
SampleType::UInt64,
70-
SampleType::Int64};
7159
ProcedureStatus status{true, {}};
7260
for (const auto& sigCtx : signalContexts)
7361
{

0 commit comments

Comments
 (0)