szaszm commented on code in PR #2054:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2054#discussion_r2477887313


##########
minifi-api/include/minifi-cpp/core/extension/ExtensionInfo.h:
##########
@@ -17,16 +18,19 @@
 
 #pragma once
 
-#include "Extension.h"
+#include <string>
+#include <optional>
+#include "minifi-cpp/properties/Configure.h"
 
 namespace org::apache::nifi::minifi::core::extension {
 
-class ExtensionManager {
- public:
-  static ExtensionManager& get();
-
-  virtual void registerExtension(Extension& extension) = 0;
-  virtual void unregisterExtension(Extension& extension) = 0;
+struct ExtensionInfo {
+  std::string name;
+  std::string version;

Review Comment:
   the return type should not contain C++ types either. I could imagine a 
`const char*` pointing to a static string within the extension.



##########
extensions/opencv/OpenCVLoader.cpp:
##########
@@ -15,18 +15,27 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "core/extension/Extension.h"
+#include "minifi-cpp/core/extension/ExtensionInfo.h"
+#include "minifi-cpp/properties/Configure.h"
 #include "utils/Environment.h"
+#include "minifi-cpp/agent/agent_version.h"
 
-static bool init(const std::shared_ptr<org::apache::nifi::minifi::Configure>& 
/*config*/) {
+namespace minifi = org::apache::nifi::minifi;
+
+extern "C" minifi::core::extension::ExtensionInitializer InitExtension = [] 
(const std::shared_ptr<minifi::Configure>& /*config*/) -> 
std::optional<minifi::core::extension::ExtensionInfo> {

Review Comment:
   I think this could stay a normal function. Also not sure if shared_ptr and 
C++ types are a good idea here, I would use C types.



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