Mercurial > hg > orthanc-databases
comparison Framework/Plugins/DatabaseBackendAdapterV3.cpp @ 221:73cc85f3d9c1
implementation of the "serverIdentifier" information for global properties
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 Mar 2021 10:40:34 +0200 |
parents | 821d4ba83dc3 |
children | c8e06b41feec |
comparison
equal
deleted
inserted
replaced
220:492aa3edf572 | 221:73cc85f3d9c1 |
---|---|
1488 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetContext()); | 1488 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetContext()); |
1489 } | 1489 } |
1490 | 1490 |
1491 | 1491 |
1492 static OrthancPluginErrorCode LookupGlobalProperty(OrthancPluginDatabaseTransaction* transaction, | 1492 static OrthancPluginErrorCode LookupGlobalProperty(OrthancPluginDatabaseTransaction* transaction, |
1493 const char* serverIdentifier, | |
1493 int32_t property) | 1494 int32_t property) |
1494 { | 1495 { |
1495 DatabaseBackendAdapterV3::Transaction* t = reinterpret_cast<DatabaseBackendAdapterV3::Transaction*>(transaction); | 1496 DatabaseBackendAdapterV3::Transaction* t = reinterpret_cast<DatabaseBackendAdapterV3::Transaction*>(transaction); |
1496 | 1497 |
1497 try | 1498 try |
1498 { | 1499 { |
1499 t->GetOutput().Clear(); | 1500 t->GetOutput().Clear(); |
1500 | 1501 |
1501 std::string s; | 1502 std::string s; |
1502 if (t->GetBackend().LookupGlobalProperty(s, property)) | 1503 if (t->GetBackend().LookupGlobalProperty(s, serverIdentifier, property)) |
1503 { | 1504 { |
1504 t->GetOutput().AnswerString(s); | 1505 t->GetOutput().AnswerString(s); |
1505 } | 1506 } |
1506 | 1507 |
1507 return OrthancPluginErrorCode_Success; | 1508 return OrthancPluginErrorCode_Success; |
1681 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetContext()); | 1682 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetContext()); |
1682 } | 1683 } |
1683 | 1684 |
1684 | 1685 |
1685 static OrthancPluginErrorCode SetGlobalProperty(OrthancPluginDatabaseTransaction* transaction, | 1686 static OrthancPluginErrorCode SetGlobalProperty(OrthancPluginDatabaseTransaction* transaction, |
1687 const char* serverIdentifier, | |
1686 int32_t property, | 1688 int32_t property, |
1687 const char* value) | 1689 const char* value) |
1688 { | 1690 { |
1689 DatabaseBackendAdapterV3::Transaction* t = reinterpret_cast<DatabaseBackendAdapterV3::Transaction*>(transaction); | 1691 DatabaseBackendAdapterV3::Transaction* t = reinterpret_cast<DatabaseBackendAdapterV3::Transaction*>(transaction); |
1690 | 1692 |
1691 try | 1693 try |
1692 { | 1694 { |
1693 t->GetOutput().Clear(); | 1695 t->GetOutput().Clear(); |
1694 t->GetBackend().SetGlobalProperty(property, value); | 1696 t->GetBackend().SetGlobalProperty(serverIdentifier, property, value); |
1695 return OrthancPluginErrorCode_Success; | 1697 return OrthancPluginErrorCode_Success; |
1696 } | 1698 } |
1697 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetContext()); | 1699 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetContext()); |
1698 } | 1700 } |
1699 | 1701 |