adamdebreceni commented on code in PR #1902:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1902#discussion_r1948900946
##########
extensions/mqtt/processors/PublishMQTT.h:
##########
@@ -23,25 +23,25 @@
#include <utility>
#include <vector>
-#include "FlowFileRecord.h"
-#include "RelationshipDefinition.h"
+#include "core/RelationshipDefinition.h"
#include "core/Processor.h"
-#include "RelationshipDefinition.h"
#include "core/ProcessSession.h"
#include "core/PropertyDefinitionBuilder.h"
#include "core/Core.h"
#include "core/Property.h"
-#include "core/logging/LoggerConfiguration.h"
+#include "core/logging/LoggerFactory.h"
#include "AbstractMQTTProcessor.h"
#include "utils/ArrayUtils.h"
#include "utils/gsl.h"
+#include "core/ProcessorMetrics.h"
namespace org::apache::nifi::minifi::processors {
class PublishMQTT : public processors::AbstractMQTTProcessor {
public:
explicit PublishMQTT(std::string_view name, const utils::Identifier& uuid =
{})
- : processors::AbstractMQTTProcessor(name, uuid,
std::make_shared<PublishMQTTMetrics>(*this, in_flight_message_counter_)) {
+ : processors::AbstractMQTTProcessor(name, uuid) {
+ metrics_ = gsl::make_not_null(std::make_shared<PublishMQTTMetrics>(*this,
in_flight_message_counter_));
Review Comment:
```
c++20
11.10.5.3
To explicitly or implicitly convert a pointer (a glvalue) referring to an
object of class X to a pointer (reference)
to a direct or indirect base class B of X, the construction of X and the
construction of all of its direct or
indirect bases that directly or indirectly derive from B shall have started
and the destruction of these classes
shall not have completed, otherwise the conversion results in undefined
behavior. To form a pointer to (or
access the value of) a direct non-static member of an object obj, the
construction of obj shall have started
and its destruction shall not have completed, otherwise the computation of
the pointer value (or accessing
the member value) results in undefined behavior.
[Example 3 :
struct A { };
struct B : virtual A { };
struct C : B { };
struct D : virtual A { D(A*); };
struct X { X(A*); };
struct E : C, D, X {
E() : D(this), // undefined behavior: upcast from E* to A* can use path E*
→ D* → A*
// but D is not constructed
// "D((C*)this)" would be defined: E* → C* is defined because E() has
started,
// and C* → A* is defined because C is fully constructed
X(this) {} // defined: upon construction of X, C/B/D/A sublattice is
fully constructed
};
— end example]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]