szaszm commented on a change in pull request #1170:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1170#discussion_r712829713
##########
File path: libminifi/include/io/StreamPipe.h
##########
@@ -42,6 +42,11 @@ class OutputStreamCallback {
virtual ~OutputStreamCallback() = default;
virtual int64_t process(const std::shared_ptr<io::BaseStream>& stream) = 0;
};
+class InputOutputStreamCallback {
+ public:
+ virtual ~InputOutputStreamCallback() = default;
+ virtual int64_t process(const std::shared_ptr<io::BaseStream>& input, const
std::shared_ptr<io::BaseStream>& output) = 0;
+};
Review comment:
Instead of following the same flawed pattern of the past, I prefer doing
things the C++ way, which in this case would be passing function objects
directly (potentially type-erased using std::function) instead of making them
have to inherit *Callback.
`LineByLineInputOutputStreamCallback` could still exist, but `process` would
need to become `operator()` and it wouldn't need to be a subclass.
--
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]