changeset 195:d7a6e75558ee java-code-model

documented orthanc.RegisterOnChangeCallback()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 02 Jul 2024 18:56:28 +0200
parents 0c5da632f34d
children d7a342f10bea
files CodeAnalysis/CustomFunctions.json Sources/Autogenerated/orthanc.pyi Sources/Autogenerated/sdk_GlobalFunctions.impl.h Sources/Plugin.cpp
diffstat 4 files changed, 31 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/CodeAnalysis/CustomFunctions.json	Tue Jul 02 18:47:12 2024 +0200
+++ b/CodeAnalysis/CustomFunctions.json	Tue Jul 02 18:56:28 2024 +0200
@@ -21,5 +21,24 @@
       }
     ],
     "return_sdk_type" : "void"
+  },
+
+  {
+    "short_name" : "RegisterOnChangeCallback",
+    "implementation" : "RegisterOnChangeCallback",
+    "documentation" : {
+      "description" : [ "Register a callback to monitor changes." ],
+      "args" : {
+        "callback" : "The callback function."
+      }
+    },
+    "args" : [
+      {
+        "sdk_name" : "callback",
+        "sdk_type" : "Callable",
+        "callable_type" : "typing.Callable[[ChangeType, ResourceType, str], None]"
+      }
+    ],
+    "return_sdk_type" : "void"
   }
 ]
--- a/Sources/Autogenerated/orthanc.pyi	Tue Jul 02 18:47:12 2024 +0200
+++ b/Sources/Autogenerated/orthanc.pyi	Tue Jul 02 18:56:28 2024 +0200
@@ -2090,6 +2090,15 @@
       data (bytes): The content of the memory buffer.
     """
     ...
+# Register a callback to monitor changes
+def RegisterOnChangeCallback(callback: typing.Callable[[ChangeType, ResourceType, str], None]) -> None:
+    """
+    Register a callback to monitor changes.
+
+    Args:
+      callback (typing.Callable[[ChangeType, ResourceType, str], None]): The callback function.
+    """
+    ...
 # Register a REST callback
 def RegisterRestCallback(path_regular_expression: str, callback: typing.Callable[[RestOutput, str], None]) -> None:
     """
--- a/Sources/Autogenerated/sdk_GlobalFunctions.impl.h	Tue Jul 02 18:47:12 2024 +0200
+++ b/Sources/Autogenerated/sdk_GlobalFunctions.impl.h	Tue Jul 02 18:56:28 2024 +0200
@@ -23,6 +23,7 @@
 
 
 // Forward declaration of the custom global functions
+extern PyObject *RegisterOnChangeCallback(PyObject* module, PyObject *args);
 extern PyObject *RegisterRestCallback(PyObject* module, PyObject *args);
 // End of forward declarations
 
@@ -2017,6 +2018,8 @@
     "Generated from C function OrthancPluginUncompressImage()" },
   { "WriteFile", sdk_OrthancPluginWriteFile, METH_VARARGS,
     "Generated from C function OrthancPluginWriteFile()" },
+  { "RegisterOnChangeCallback", RegisterOnChangeCallback, METH_VARARGS,
+    "Implemented in C++ function RegisterOnChangeCallback()" },
   { "RegisterRestCallback", RegisterRestCallback, METH_VARARGS,
     "Implemented in C++ function RegisterRestCallback()" },
   { NULL, NULL }
--- a/Sources/Plugin.cpp	Tue Jul 02 18:47:12 2024 +0200
+++ b/Sources/Plugin.cpp	Tue Jul 02 18:56:28 2024 +0200
@@ -284,11 +284,6 @@
   std::list<PyMethodDef> functions;
 
   {
-    PyMethodDef f = { "RegisterOnChangeCallback", RegisterOnChangeCallback, METH_VARARGS, "" };
-    functions.push_back(f);
-  }
-
-  {
     PyMethodDef f = { "RegisterOnStoredInstanceCallback", RegisterOnStoredInstanceCallback,
                       METH_VARARGS, "" };
     functions.push_back(f);