[ https://issues.apache.org/jira/browse/MINIFICPP-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16679692#comment-16679692 ]
ASF GitHub Bot commented on MINIFICPP-648: ------------------------------------------ Github user phrocker commented on a diff in the pull request: https://github.com/apache/nifi-minifi-cpp/pull/432#discussion_r231867815 --- Diff: nanofi/src/api/nanofi.cpp --- @@ -323,55 +360,45 @@ int transmit_flowfile(flow_file_record *ff, nifi_instance *instance) { flow * create_new_flow(nifi_instance * instance) { auto minifi_instance_ref = static_cast<minifi::Instance*>(instance->instance_ptr); - flow *new_flow = (flow*) malloc(sizeof(flow)); - - auto execution_plan = new ExecutionPlan(minifi_instance_ref->getContentRepository(), minifi_instance_ref->getNoOpRepository(), minifi_instance_ref->getNoOpRepository()); - - new_flow->plan = execution_plan; - - return new_flow; + return new flow(minifi_instance_ref->getContentRepository(), minifi_instance_ref->getNoOpRepository(), minifi_instance_ref->getNoOpRepository()); } flow *create_flow(nifi_instance *instance, const char *first_processor) { if (nullptr == instance || nullptr == instance->instance_ptr) { return nullptr; } auto minifi_instance_ref = static_cast<minifi::Instance*>(instance->instance_ptr); - flow *new_flow = (flow*) malloc(sizeof(flow)); - - auto execution_plan = new ExecutionPlan(minifi_instance_ref->getContentRepository(), minifi_instance_ref->getNoOpRepository(), minifi_instance_ref->getNoOpRepository()); - new_flow->plan = execution_plan; + flow *new_flow = new flow(minifi_instance_ref->getContentRepository(), minifi_instance_ref->getNoOpRepository(), minifi_instance_ref->getNoOpRepository()); if (first_processor != nullptr && strlen(first_processor) > 0) { // automatically adds it with success - execution_plan->addProcessor(first_processor, first_processor); --- End diff -- Combined C and C++ implies we're moving more toward C++. If that were the case this API would be drastically different. We should move in the other direction since C++ functions as a temporary interconnect. > add processor and add processor with linkage nomenclature is confusing > ---------------------------------------------------------------------- > > Key: MINIFICPP-648 > URL: https://issues.apache.org/jira/browse/MINIFICPP-648 > Project: NiFi MiNiFi C++ > Issue Type: Improvement > Reporter: Mr TheSegfault > Assignee: Arpad Boda > Priority: Blocker > Labels: CAPI > Fix For: 0.6.0 > > > add_processor should be changed to always add a processor with linkage > without compelling documentation as why this exists.. As a result we will > need to add a create_processor function to create one without adding it to > the flow ( certain use cases where a flow isn't needed such as invokehttp or > listenhttp ) this can be moved to 0.7.0 if we tag before recent commits. -- This message was sent by Atlassian JIRA (v7.6.3#76005)