bakaid commented on a change in pull request #636: Minificpp-780 - Change
GenerateFlowFile to allow 0b content FlowFiles
URL: https://github.com/apache/nifi-minifi-cpp/pull/636#discussion_r343694089
##########
File path: extensions/standard-processors/processors/GenerateFlowFile.h
##########
@@ -40,55 +40,56 @@ class GenerateFlowFile : public core::Processor {
*/
GenerateFlowFile(std::string name, utils::Identifier uuid =
utils::Identifier())
: Processor(name, uuid),
logger_(logging::LoggerFactory<GenerateFlowFile>::getLogger()) {
- _data = NULL;
- _dataSize = 0;
+ batchSize_ = 1;
+ uniqueFlowFile_ = true;
+ fileSize_ = 1024;
+ textData_ = false;
}
// Destructor
- virtual ~GenerateFlowFile() {
- if (_data)
- delete[] _data;
- }
+ virtual ~GenerateFlowFile() = default;
// Processor Name
static constexpr char const* ProcessorName = "GenerateFlowFile";
// Supported Properties
static core::Property FileSize;
static core::Property BatchSize;
static core::Property DataFormat;
static core::Property UniqueFlowFiles;
- static const char *DATA_FORMAT_BINARY;
static const char *DATA_FORMAT_TEXT;
// Supported Relationships
static core::Relationship Success;
// Nest Callback Class for write stream
class WriteCallback : public OutputStreamCallback {
public:
- WriteCallback(char *data, uint64_t size)
- : _data(data),
- _dataSize(size) {
+ WriteCallback(std::vector<char> && data) : data_(data) {
Review comment:
I think this needs a std::move here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services