changeset 5217:eb41e1833cea db-protobuf

documentation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Apr 2023 16:54:46 +0200
parents 450ac804d3af
children afa96af2eb5a
files NEWS OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h
diffstat 2 files changed, 23 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Mon Apr 03 14:49:33 2023 +0200
+++ b/NEWS	Mon Apr 03 16:54:46 2023 +0200
@@ -5,18 +5,20 @@
 --------
 
 * API version upgraded to 20
-* /system: added UserMetadata
+* /system: added "UserMetadata"
+
+Plugins
+-------
+
+* Added "OrthancPluginRegisterDatabaseBackendV4()" to communicate using Google
+  Protocol Buffers between the Orthanc core and database plugins
 
 Maintenance
 -----------
 
 * Enforce the existence of the patient/study/instance while creating its archive
 * Security: New configuration option "RestApiWriteToFileSystemEnabled"
-  to allow "/instances/../export" that is now disabled by default.
-
-Bug Fixes
----------
-
+  to allow "/instances/../export" that is now disabled by default
 * Fix issue 214: VOILUTSequence is not returned in Wado-RS
 * Fix /tools/reset crashing when ExtraMainDicomTags were defined
 
--- a/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h	Mon Apr 03 14:49:33 2023 +0200
+++ b/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h	Mon Apr 03 16:54:46 2023 +0200
@@ -9166,7 +9166,9 @@
 
 
   /**
-   * @brief 
+   * @brief Signature of a callback function that is triggered when
+   * the Orthanc core requests an operation from the database plugin.
+   * Both request and response are encoded as protobuf buffers.
    * @ingroup Callbacks
    **/
   typedef OrthancPluginErrorCode (*OrthancPluginCallDatabaseBackendV4) (
@@ -9176,7 +9178,8 @@
     uint64_t requestSize);
 
   /**
-   * @brief 
+   * @brief Signature of a callback function that is triggered when
+   * the database plugin must be finalized.
    * @ingroup Callbacks
    **/
   typedef void (*OrthancPluginFinalizeDatabaseBackendV4) (void* backend);
@@ -9192,17 +9195,24 @@
   /**
    * Register a custom database back-end.
    *
-   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * This function was added in Orthanc SDK 1.12.0. It uses Google
+   * Protocol Buffers for the communications between the Orthanc core
+   * and database plugins. Check out "OrthancDatabasePlugin.proto" for
+   * the definition of the protobuf messages.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param backend Pointer to the custom database backend.
+   * @param maxDatabaseRetries Maximum number of retries if transaction doesn't succeed.
+   * If no retry is successful, OrthancPluginErrorCode_DatabaseCannotSerialize is generated.
    * @param operations Access to the operations of the custom database backend.
    * @param finalize Callback to deallocate the custom database backend.
-   * @param backend Pointer to the custom database backend.
    * @return 0 if success, other value if error.
    * @ingroup Callbacks
    **/
   ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDatabaseBackendV4(
     OrthancPluginContext*                   context,
     void*                                   backend,
-    uint32_t                                maxDatabaseRetries,  /* To handle "OrthancPluginErrorCode_DatabaseCannotSerialize" */
+    uint32_t                                maxDatabaseRetries,
     OrthancPluginCallDatabaseBackendV4      operations,
     OrthancPluginFinalizeDatabaseBackendV4  finalize)
   {