szaszm commented on a change in pull request #1170:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1170#discussion_r714758131



##########
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:
       Yes, I meant that, except that I would pass the std::function by value. 
It would be better because in C++, we usually pass functions as simple callable 
objects, as opposed to the java way of implementing an interface with only one 
public method. The *StreamCallback classes are useless in C++ and only serve 
the purpose of imitating the Java way of passing functions in C++. We should be 
able to pass a lambda or any other normal function object directly to functions 
that expect another function as parameter.




-- 
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]


Reply via email to