adamdebreceni commented on code in PR #1751:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1751#discussion_r1683918112
##########
libminifi/include/c2/C2Payload.h:
##########
@@ -79,21 +85,65 @@ enum Direction {
RECEIVE
};
-struct AnnotatedValue : state::response::ValueNode {
- using state::response::ValueNode::ValueNode;
- using state::response::ValueNode::operator=;
+class C2Value {
+ public:
+ friend std::ostream& operator<<(std::ostream& out, const C2Value& val);
+
+ C2Value() = default;
+ C2Value(const C2Value& other) {
+ (*this) = other;
+ }
+ C2Value(C2Value&&) = default;
+ template<typename T>
+ requires(std::constructible_from<state::response::ValueNode, T>)
+ C2Value(T&& value) { value_ =
state::response::ValueNode{std::forward<T>(value)}; } //
NOLINT(runtime/explicit)
+ C2Value(const rapidjson::Value& json_value) { // NOLINT(runtime/explicit)
+ value_.emplace<rapidjson::Document>();
+ get<rapidjson::Document>(value_).CopyFrom(json_value,
get<rapidjson::Document>(value_).GetAllocator());
+ }
+ C2Value(rapidjson::Document&& json_doc) { // NOLINT(runtime/explicit)
Review Comment:
done
##########
libminifi/include/c2/protocols/RESTProtocol.h:
##########
@@ -43,7 +43,7 @@ class RESTProtocol : public HeartbeatJsonSerializer {
protected:
void initialize(core::controller::ControllerServiceProvider* controller,
const std::shared_ptr<Configure> &configure);
void serializeNestedPayload(rapidjson::Value& target, const C2Payload&
payload, rapidjson::Document::AllocatorType& alloc) override;
- static C2Payload parseJsonResponse(const C2Payload &payload, std::span<const
std::byte> response);
+ C2Payload parseJsonResponse(const C2Payload &payload, std::span<const
std::byte> response);
Review Comment:
done
--
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]