comparison OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp @ 5455:176bc05f85f4 pg-transactions

DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
author Alain Mazy <am@osimis.io>
date Thu, 07 Dec 2023 12:04:11 +0100
parents f22c8fac764b
children dceed5e3d6a9
comparison
equal deleted inserted replaced
5454:099d45f49fe1 5455:176bc05f85f4
41 #include <cassert> 41 #include <cassert>
42 42
43 namespace Orthanc 43 namespace Orthanc
44 { 44 {
45 class OrthancPluginDatabase::Transaction : 45 class OrthancPluginDatabase::Transaction :
46 public IDatabaseWrapper::ITransaction, 46 public BaseDatabaseWrapper::BaseTransaction,
47 public Compatibility::ICreateInstance, 47 public Compatibility::ICreateInstance,
48 public Compatibility::IGetChildrenMetadata, 48 public Compatibility::IGetChildrenMetadata,
49 public Compatibility::ILookupResources, 49 public Compatibility::ILookupResources,
50 public Compatibility::ILookupResourceAndParent, 50 public Compatibility::ILookupResourceAndParent,
51 public Compatibility::ISetResourcesContent 51 public Compatibility::ISetResourcesContent
239 239
240 virtual ~Transaction() 240 virtual ~Transaction()
241 { 241 {
242 assert(that_.activeTransaction_ != NULL); 242 assert(that_.activeTransaction_ != NULL);
243 that_.activeTransaction_ = NULL; 243 that_.activeTransaction_ = NULL;
244 }
245
246 virtual const IDatabaseWrapper::Capabilities& GetDatabaseCapabilities() const ORTHANC_OVERRIDE
247 {
248 return that_.GetDatabaseCapabilities();
244 } 249 }
245 250
246 IDatabaseListener& GetDatabaseListener() const 251 IDatabaseListener& GetDatabaseListener() const
247 { 252 {
248 return listener_; 253 return listener_;
1470 errorDictionary_(errorDictionary), 1475 errorDictionary_(errorDictionary),
1471 backend_(backend), 1476 backend_(backend),
1472 payload_(payload), 1477 payload_(payload),
1473 activeTransaction_(NULL), 1478 activeTransaction_(NULL),
1474 fastGetTotalSize_(false), 1479 fastGetTotalSize_(false),
1475 currentDiskSize_(0) 1480 currentDiskSize_(0),
1481 dbCapabilities_(false, false, false, false)
1476 { 1482 {
1477 static const char* const MISSING = " Missing extension in database index plugin: "; 1483 static const char* const MISSING = " Missing extension in database index plugin: ";
1478 1484
1479 memset(&extensions_, 0, sizeof(extensions_)); 1485 memset(&extensions_, 0, sizeof(extensions_));
1480 1486