martinzink commented on code in PR #2152:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2152#discussion_r3159360987


##########
extension-framework/cpp-extension-lib/include/api/utils/ProcessorConfigUtils.h:
##########
@@ -167,4 +167,28 @@ std::optional<T> parseOptionalEnumProperty(const 
core::ProcessContext& context,
   return result.value();
 }
 
+template<typename ControllerServiceType>
+ControllerServiceType* parseOptionalControllerService(const 
core::ProcessContext& context, const minifi::core::PropertyReference& prop) {
+  const auto controller_service_name = context.getProperty(prop.name);
+  if (!controller_service_name || controller_service_name->empty()) {
+    return nullptr;
+  }
+
+  nonstd::expected<MinifiControllerService*, std::error_code> service = 
context.getControllerService(*controller_service_name, 
minifi::core::className<ControllerServiceType>());

Review Comment:
   👍 [rebase 
fix](https://github.com/apache/nifi-minifi-cpp/pull/2152/commits/991fa3e0ba38410828ca33d3de6ead23c91e39d4)



##########
extension-framework/cpp-extension-lib/src/core/ProcessContext.cpp:
##########
@@ -38,4 +38,17 @@ bool ProcessContext::hasNonEmptyProperty(std::string_view 
name) const {
   return MinifiProcessContextHasNonEmptyProperty(impl_, 
utils::toStringView(name));
 }
 
+nonstd::expected<MinifiControllerService*, std::error_code> 
ProcessContext::getControllerService(const std::string_view 
controller_service_name,
+    const std::string_view controller_service_class) const {
+  void* controller_service = nullptr;

Review Comment:
   👍 [rebase 
fix](https://github.com/apache/nifi-minifi-cpp/pull/2152/commits/991fa3e0ba38410828ca33d3de6ead23c91e39d4)



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