comparison OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp @ 4607:f75c63aa9de0 db-changes

differentiating between shared and private global properties
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 Mar 2021 18:10:27 +0200
parents cc64385593ef
children 95ffe3b6ef7c
comparison
equal deleted inserted replaced
4606:d01702fb29a9 4607:f75c63aa9de0
1127 } 1127 }
1128 } 1128 }
1129 1129
1130 1130
1131 virtual bool LookupGlobalProperty(std::string& target, 1131 virtual bool LookupGlobalProperty(std::string& target,
1132 GlobalProperty property) ORTHANC_OVERRIDE 1132 GlobalProperty property,
1133 { 1133 bool shared) ORTHANC_OVERRIDE
1134 {
1135 // "shared" is unused, as database plugins using Orthanc SDK <=
1136 // 1.9.1 are not compatible with multiple readers/writers
1137
1134 ResetAnswers(); 1138 ResetAnswers();
1135 1139
1136 CheckSuccess(that_.backend_.lookupGlobalProperty 1140 CheckSuccess(that_.backend_.lookupGlobalProperty
1137 (that_.GetContext(), that_.payload_, static_cast<int32_t>(property))); 1141 (that_.GetContext(), that_.payload_, static_cast<int32_t>(property)));
1138 1142
1289 return ForwardSingleAnswer(internalId); 1293 return ForwardSingleAnswer(internalId);
1290 } 1294 }
1291 1295
1292 1296
1293 virtual void SetGlobalProperty(GlobalProperty property, 1297 virtual void SetGlobalProperty(GlobalProperty property,
1298 bool shared,
1294 const std::string& value) ORTHANC_OVERRIDE 1299 const std::string& value) ORTHANC_OVERRIDE
1295 { 1300 {
1301 // "shared" is unused, as database plugins using Orthanc SDK <=
1302 // 1.9.1 are not compatible with multiple readers/writers
1303
1296 CheckSuccess(that_.backend_.setGlobalProperty 1304 CheckSuccess(that_.backend_.setGlobalProperty
1297 (that_.payload_, static_cast<int32_t>(property), value.c_str())); 1305 (that_.payload_, static_cast<int32_t>(property), value.c_str()));
1298 } 1306 }
1299 1307
1300 1308
1525 Transaction transaction(*this, listener); 1533 Transaction transaction(*this, listener);
1526 transaction.Begin(); 1534 transaction.Begin();
1527 1535
1528 std::string tmp; 1536 std::string tmp;
1529 fastGetTotalSize_ = 1537 fastGetTotalSize_ =
1530 (transaction.LookupGlobalProperty(tmp, GlobalProperty_GetTotalSizeIsFast) && 1538 (transaction.LookupGlobalProperty(tmp, GlobalProperty_GetTotalSizeIsFast, true /* unused in old databases */) &&
1531 tmp == "1"); 1539 tmp == "1");
1532 1540
1533 if (fastGetTotalSize_) 1541 if (fastGetTotalSize_)
1534 { 1542 {
1535 currentDiskSize_ = 0; // Unused 1543 currentDiskSize_ = 0; // Unused