[
https://issues.apache.org/jira/browse/MINIFICPP-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16688290#comment-16688290
]
ASF GitHub Bot commented on MINIFICPP-667:
------------------------------------------
Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/436#discussion_r233911441
--- Diff: nanofi/src/api/nanofi.cpp ---
@@ -72,19 +41,17 @@ class DirectoryConfiguration {
* nifi_instance *create_instance(nifi_port const *port) {
*/
nifi_instance *create_instance(const char *url, nifi_port *port) {
- // make sure that we have a thread safe way of initializing the content
directory
- DirectoryConfiguration::initialize();
-
- // need reinterpret cast until we move to C for this module.
- nifi_instance *instance =
reinterpret_cast<nifi_instance*>(malloc(sizeof(nifi_instance)));
+ // need reinterpret cast until we move to C for this module.
+ nifi_instance *instance =
(nifi_instance*)(malloc(sizeof(nifi_instance)));
/**
* This API will gradually move away from C++, hence malloc is used for
nifi_instance
* Since minifi::Instance is currently being used, then we need to use
new in that case.
*/
- instance->instance_ptr = new minifi::Instance(url, port->port_id);
+ instance->instance_ptr = create_cxx_instance(url,port);
// may have to translate port ID here in the future
// need reinterpret cast until we move to C for this module.
- instance->port.port_id =
reinterpret_cast<char*>(malloc(strlen(port->port_id) + 1));
+ instance->port.port_id = (char*)(malloc(strlen(port->port_id) + 1));
--- End diff --
Yes. We won't be able to use the C++ linter on C files. I haven't pushed
the recent commit, but I'm moving toward renaming this to nanofi.c
> Create Structural definitions for moving away from C++ classes
> --------------------------------------------------------------
>
> Key: MINIFICPP-667
> URL: https://issues.apache.org/jira/browse/MINIFICPP-667
> Project: NiFi MiNiFi C++
> Issue Type: Improvement
> Affects Versions: nanofi
> Reporter: Mr TheSegfault
> Assignee: Mr TheSegfault
> Priority: Major
> Fix For: 0.6.0
>
>
> Create Structural definitions for moving away from C++ classes
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)