lordgamez commented on code in PR #1530:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1530#discussion_r1135604961


##########
extensions/python/types/PyStateManager.cpp:
##########
@@ -0,0 +1,103 @@
+/**
+ * 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,
+a * 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.
+ */
+
+#include "PyStateManager.h"
+#include <string>
+#include "PyException.h"
+
+extern "C" {
+namespace org::apache::nifi::minifi::extensions::python {
+
+static PyMethodDef PyStateManager_methods[] = {

Review Comment:
   Why does this have a different naming convention than the others?



##########
extensions/lua/LuaScriptProcessContext.h:
##########
@@ -22,18 +22,22 @@
 #include <memory>
 
 #include "core/ProcessSession.h"
+#include "LuaScriptStateManager.h"
 
 namespace org::apache::nifi::minifi::extensions::lua {
 
 class LuaScriptProcessContext {
  public:
-  explicit LuaScriptProcessContext(std::shared_ptr<core::ProcessContext> 
context);
+  explicit LuaScriptProcessContext(std::shared_ptr<core::ProcessContext> 
context, sol::state* sol_state);
 
   std::string getProperty(const std::string &name);
   void releaseProcessContext();
 
+  LuaScriptStateManager getStateManager();
+
  private:
   std::shared_ptr<core::ProcessContext> context_;
+  sol::state* sol_state_;

Review Comment:
   Could this be a reference instead of a pointer? That should be safer.



##########
extensions/python/PythonBindings.cpp:
##########
@@ -43,15 +44,16 @@ struct PyModuleDef minifi_module = {
 
 PyMODINIT_FUNC
 PyInit_minifi_native(void) {
-  const std::array<std::pair<PyTypeObject*, std::string_view>, 8> types = {
+  const std::array<std::pair<PyTypeObject*, std::string_view>, 9> types = {

Review Comment:
   It may be better to use `std::to_array` so the element count template 
parameter wouldn't be needed to be updated every time the array is changed.
   ```
   const std::array types = std::to_array<std::pair<PyTypeObject*, 
std::string_view>>({
     std::make_pair(PyLogger::typeObject(), "Logger"),
     std::make_pair(PyProcessSessionObject::typeObject(), "ProcessSession"),
     std::make_pair(PyProcessContext::typeObject(), "ProcessContext"),
     std::make_pair(PyProcessor::typeObject(), "Processor"),
     std::make_pair(PyScriptFlowFile::typeObject(), "FlowFile"),
     std::make_pair(PyRelationship::typeObject(), "Relationship"),
     std::make_pair(PyInputStream::typeObject(), "InputStream"),
     std::make_pair(PyOutputStream::typeObject(), "OutputStream"),
     std::make_pair(PyStateManager::typeObject(), "StateManager")
   });
   ```



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