comparison Odbc/Plugins/IndexPlugin.cpp @ 388:6aa19614ca20 db-protobuf

implemented protobuf for odbc
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Apr 2023 11:14:10 +0200
parents 16aac0287485
children eb80f7c5e7d8
comparison
equal deleted inserted replaced
386:0fed785e974e 388:6aa19614ca20
40 # include <ltdl.h> 40 # include <ltdl.h>
41 # include <libltdl/lt_dlloader.h> 41 # include <libltdl/lt_dlloader.h>
42 #endif 42 #endif
43 43
44 44
45 #include <google/protobuf/any.h>
46
47
45 static const char* const KEY_ODBC = "Odbc"; 48 static const char* const KEY_ODBC = "Odbc";
46 49
47 50
48 extern "C" 51 extern "C"
49 { 52 {
52 #endif 55 #endif
53 56
54 57
55 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) 58 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
56 { 59 {
60 GOOGLE_PROTOBUF_VERIFY_VERSION;
61
57 if (!OrthancDatabases::InitializePlugin(context, "ODBC", true)) 62 if (!OrthancDatabases::InitializePlugin(context, "ODBC", true))
58 { 63 {
59 return -1; 64 return -1;
60 } 65 }
61 66
128 133
129 ORTHANC_PLUGINS_API void OrthancPluginFinalize() 134 ORTHANC_PLUGINS_API void OrthancPluginFinalize()
130 { 135 {
131 LOG(WARNING) << "ODBC index is finalizing"; 136 LOG(WARNING) << "ODBC index is finalizing";
132 OrthancDatabases::IndexBackend::Finalize(); 137 OrthancDatabases::IndexBackend::Finalize();
138 google::protobuf::ShutdownProtobufLibrary();
133 } 139 }
134 140
135 141
136 ORTHANC_PLUGINS_API const char* OrthancPluginGetName() 142 ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
137 { 143 {