Github user arpadboda commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/432#discussion_r231878067
  
    --- Diff: nanofi/include/core/cxxstructs.h ---
    @@ -0,0 +1,41 @@
    +/**
    + *
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#ifndef NIFI_MINIFI_CPP_CXXSTRUCTS_H
    +#define NIFI_MINIFI_CPP_CXXSTRUCTS_H
    +
    +#include "cstructs.h"
    +#include "cxx/Plan.h"
    +
    --- End diff --
    
    I don't think is moving that way, just simplifies the current structure. 
    There is no change in API, no change in the background C++ classes, just 
removed the C struct we used to interconnect. 
    In case the user doesn't know anything about the internal layout (the C 
struct only contains a void*), creating a struct just adds an extra hop in the 
memory, but no value. 
    With the change the user only sees these structures declared, but not 
defined and gets pointers. The reason we can do it is that the API user doesn't 
need to know the size or the internal representation of the object in case only 
gets and passes pointers. 
    We can change the internal layout as we want without impacting the API 
anyhow. Even C structs can be added later, that's fine. 


---

Reply via email to