Mercurial > hg > orthanc
changeset 5894:cdb8b2a3aad5 find-refactoring
renamed files BaseDatabaseWrapper as BaseCompatibilityTransaction
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 30 Nov 2024 21:57:48 +0100 |
parents | 1c23f71858a2 |
children | 9b039f4b1421 |
files | OrthancServer/CMakeLists.txt OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp OrthancServer/Plugins/Engine/OrthancPluginDatabase.h OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.h OrthancServer/Sources/Database/BaseCompatibilityTransaction.cpp OrthancServer/Sources/Database/BaseCompatibilityTransaction.h OrthancServer/Sources/Database/BaseDatabaseWrapper.cpp OrthancServer/Sources/Database/BaseDatabaseWrapper.h OrthancServer/Sources/Database/SQLiteDatabaseWrapper.h |
diffstat | 10 files changed, 178 insertions(+), 178 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancServer/CMakeLists.txt Sat Nov 30 21:53:37 2024 +0100 +++ b/OrthancServer/CMakeLists.txt Sat Nov 30 21:57:48 2024 +0100 @@ -88,7 +88,7 @@ ##################################################################### set(ORTHANC_SERVER_SOURCES - ${CMAKE_SOURCE_DIR}/Sources/Database/BaseDatabaseWrapper.cpp + ${CMAKE_SOURCE_DIR}/Sources/Database/BaseCompatibilityTransaction.cpp ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/DatabaseLookup.cpp ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/GenericFind.cpp ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/ICreateInstance.cpp
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp Sat Nov 30 21:53:37 2024 +0100 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp Sat Nov 30 21:57:48 2024 +0100 @@ -44,7 +44,7 @@ namespace Orthanc { class OrthancPluginDatabase::Transaction : - public BaseTransaction, + public BaseCompatibilityTransaction, public Compatibility::ICreateInstance, public Compatibility::IGetChildrenMetadata, public Compatibility::ILookupResources,
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabase.h Sat Nov 30 21:53:37 2024 +0100 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabase.h Sat Nov 30 21:57:48 2024 +0100 @@ -26,7 +26,7 @@ #if ORTHANC_ENABLE_PLUGINS == 1 #include "../../../OrthancFramework/Sources/SharedLibrary.h" -#include "../../Sources/Database/BaseDatabaseWrapper.h" +#include "../../Sources/Database/BaseCompatibilityTransaction.h" #include "../Include/orthanc/OrthancCDatabasePlugin.h" #include "PluginsErrorDictionary.h"
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp Sat Nov 30 21:53:37 2024 +0100 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp Sat Nov 30 21:57:48 2024 +0100 @@ -46,7 +46,7 @@ namespace Orthanc { - class OrthancPluginDatabaseV3::Transaction : public BaseTransaction + class OrthancPluginDatabaseV3::Transaction : public BaseCompatibilityTransaction { private: OrthancPluginDatabaseV3& that_;
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.h Sat Nov 30 21:53:37 2024 +0100 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.h Sat Nov 30 21:57:48 2024 +0100 @@ -26,7 +26,7 @@ #if ORTHANC_ENABLE_PLUGINS == 1 #include "../../../OrthancFramework/Sources/SharedLibrary.h" -#include "../../Sources/Database/BaseDatabaseWrapper.h" +#include "../../Sources/Database/BaseCompatibilityTransaction.h" #include "../Include/orthanc/OrthancCDatabasePlugin.h" #include "PluginsErrorDictionary.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OrthancServer/Sources/Database/BaseCompatibilityTransaction.cpp Sat Nov 30 21:57:48 2024 +0100 @@ -0,0 +1,93 @@ +/** + * Orthanc - A Lightweight, RESTful DICOM Store + * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium + * Copyright (C) 2017-2023 Osimis S.A., Belgium + * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium + * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + **/ + + +#include "BaseCompatibilityTransaction.h" + +#include "../../../OrthancFramework/Sources/OrthancException.h" +#include "Compatibility/GenericFind.h" + +namespace Orthanc +{ + int64_t BaseCompatibilityTransaction::IncrementGlobalProperty(GlobalProperty property, + int64_t increment, + bool shared) + { + throw OrthancException(ErrorCode_NotImplemented); // Not supported + } + + void BaseCompatibilityTransaction::UpdateAndGetStatistics(int64_t& patientsCount, + int64_t& studiesCount, + int64_t& seriesCount, + int64_t& instancesCount, + int64_t& compressedSize, + int64_t& uncompressedSize) + { + throw OrthancException(ErrorCode_NotImplemented); // Not supported + } + + void BaseCompatibilityTransaction::PerformDbHousekeeping() + { + throw OrthancException(ErrorCode_NotImplemented); // Not supported + } + + void BaseCompatibilityTransaction::GetChangesExtended(std::list<ServerIndexChange>& target /*out*/, + bool& done /*out*/, + int64_t since, + int64_t to, + uint32_t limit, + const std::set<ChangeType>& filterType) + { + throw OrthancException(ErrorCode_NotImplemented); // Not supported + } + + void BaseCompatibilityTransaction::ExecuteCount(uint64_t& count, + const FindRequest& request, + const IDatabaseWrapper::Capabilities& capabilities) + { + throw OrthancException(ErrorCode_NotImplemented); // Not supported + } + + void BaseCompatibilityTransaction::ExecuteFind(FindResponse& response, + const FindRequest& request, + const IDatabaseWrapper::Capabilities& capabilities) + { + throw OrthancException(ErrorCode_NotImplemented); // Not supported + } + + void BaseCompatibilityTransaction::ExecuteFind(std::list<std::string>& identifiers, + const IDatabaseWrapper::Capabilities& capabilities, + const FindRequest& request) + { + Compatibility::GenericFind find(*this, *this); + find.ExecuteFind(identifiers, capabilities, request); + } + + void BaseCompatibilityTransaction::ExecuteExpand(FindResponse& response, + const IDatabaseWrapper::Capabilities& capabilities, + const FindRequest& request, + const std::string& identifier) + { + Compatibility::GenericFind find(*this, *this); + find.ExecuteExpand(response, capabilities, request, identifier); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OrthancServer/Sources/Database/BaseCompatibilityTransaction.h Sat Nov 30 21:57:48 2024 +0100 @@ -0,0 +1,78 @@ +/** + * Orthanc - A Lightweight, RESTful DICOM Store + * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium + * Copyright (C) 2017-2023 Osimis S.A., Belgium + * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium + * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + **/ + + +#pragma once + +#include "IDatabaseWrapper.h" + +namespace Orthanc +{ + /** + * This class provides a default "not implemented" implementation + * for all recent methods (1.12.X) + **/ + + class BaseCompatibilityTransaction : + public IDatabaseWrapper::ITransaction, + public IDatabaseWrapper::ICompatibilityTransaction + { + public: + virtual int64_t IncrementGlobalProperty(GlobalProperty property, + int64_t increment, + bool shared) ORTHANC_OVERRIDE; + + virtual void UpdateAndGetStatistics(int64_t& patientsCount, + int64_t& studiesCount, + int64_t& seriesCount, + int64_t& instancesCount, + int64_t& compressedSize, + int64_t& uncompressedSize) ORTHANC_OVERRIDE; + + virtual void PerformDbHousekeeping() ORTHANC_OVERRIDE; + + virtual void ExecuteCount(uint64_t& count, + const FindRequest& request, + const IDatabaseWrapper::Capabilities& capabilities) ORTHANC_OVERRIDE; + + virtual void ExecuteFind(FindResponse& response, + const FindRequest& request, + const IDatabaseWrapper::Capabilities& capabilities) ORTHANC_OVERRIDE; + + virtual void ExecuteFind(std::list<std::string>& identifiers, + const IDatabaseWrapper::Capabilities& capabilities, + const FindRequest& request) ORTHANC_OVERRIDE; + + virtual void ExecuteExpand(FindResponse& response, + const IDatabaseWrapper::Capabilities& capabilities, + const FindRequest& request, + const std::string& identifier) ORTHANC_OVERRIDE; + + virtual void GetChangesExtended(std::list<ServerIndexChange>& target /*out*/, + bool& done /*out*/, + int64_t since, + int64_t to, + uint32_t limit, + const std::set<ChangeType>& filterType) ORTHANC_OVERRIDE; + }; + +}
--- a/OrthancServer/Sources/Database/BaseDatabaseWrapper.cpp Sat Nov 30 21:53:37 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/** - * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -#include "BaseDatabaseWrapper.h" - -#include "../../../OrthancFramework/Sources/OrthancException.h" -#include "Compatibility/GenericFind.h" - -namespace Orthanc -{ - int64_t BaseTransaction::IncrementGlobalProperty(GlobalProperty property, - int64_t increment, - bool shared) - { - throw OrthancException(ErrorCode_NotImplemented); // Not supported - } - - void BaseTransaction::UpdateAndGetStatistics(int64_t& patientsCount, - int64_t& studiesCount, - int64_t& seriesCount, - int64_t& instancesCount, - int64_t& compressedSize, - int64_t& uncompressedSize) - { - throw OrthancException(ErrorCode_NotImplemented); // Not supported - } - - void BaseTransaction::PerformDbHousekeeping() - { - throw OrthancException(ErrorCode_NotImplemented); // Not supported - } - - void BaseTransaction::GetChangesExtended(std::list<ServerIndexChange>& target /*out*/, - bool& done /*out*/, - int64_t since, - int64_t to, - uint32_t limit, - const std::set<ChangeType>& filterType) - { - throw OrthancException(ErrorCode_NotImplemented); // Not supported - } - - void BaseTransaction::ExecuteCount(uint64_t& count, - const FindRequest& request, - const IDatabaseWrapper::Capabilities& capabilities) - { - throw OrthancException(ErrorCode_NotImplemented); // Not supported - } - - void BaseTransaction::ExecuteFind(FindResponse& response, - const FindRequest& request, - const IDatabaseWrapper::Capabilities& capabilities) - { - throw OrthancException(ErrorCode_NotImplemented); // Not supported - } - - void BaseTransaction::ExecuteFind(std::list<std::string>& identifiers, - const IDatabaseWrapper::Capabilities& capabilities, - const FindRequest& request) - { - Compatibility::GenericFind find(*this, *this); - find.ExecuteFind(identifiers, capabilities, request); - } - - void BaseTransaction::ExecuteExpand(FindResponse& response, - const IDatabaseWrapper::Capabilities& capabilities, - const FindRequest& request, - const std::string& identifier) - { - Compatibility::GenericFind find(*this, *this); - find.ExecuteExpand(response, capabilities, request, identifier); - } -}
--- a/OrthancServer/Sources/Database/BaseDatabaseWrapper.h Sat Nov 30 21:53:37 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/** - * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -#pragma once - -#include "IDatabaseWrapper.h" - -namespace Orthanc -{ - /** - * This class provides a default "not implemented" implementation - * for all recent methods (1.12.X) - **/ - - class BaseTransaction : - public IDatabaseWrapper::ITransaction, - public IDatabaseWrapper::ICompatibilityTransaction - { - public: - virtual int64_t IncrementGlobalProperty(GlobalProperty property, - int64_t increment, - bool shared) ORTHANC_OVERRIDE; - - virtual void UpdateAndGetStatistics(int64_t& patientsCount, - int64_t& studiesCount, - int64_t& seriesCount, - int64_t& instancesCount, - int64_t& compressedSize, - int64_t& uncompressedSize) ORTHANC_OVERRIDE; - - virtual void PerformDbHousekeeping() ORTHANC_OVERRIDE; - - virtual void ExecuteCount(uint64_t& count, - const FindRequest& request, - const IDatabaseWrapper::Capabilities& capabilities) ORTHANC_OVERRIDE; - - virtual void ExecuteFind(FindResponse& response, - const FindRequest& request, - const IDatabaseWrapper::Capabilities& capabilities) ORTHANC_OVERRIDE; - - virtual void ExecuteFind(std::list<std::string>& identifiers, - const IDatabaseWrapper::Capabilities& capabilities, - const FindRequest& request) ORTHANC_OVERRIDE; - - virtual void ExecuteExpand(FindResponse& response, - const IDatabaseWrapper::Capabilities& capabilities, - const FindRequest& request, - const std::string& identifier) ORTHANC_OVERRIDE; - - virtual void GetChangesExtended(std::list<ServerIndexChange>& target /*out*/, - bool& done /*out*/, - int64_t since, - int64_t to, - uint32_t limit, - const std::set<ChangeType>& filterType) ORTHANC_OVERRIDE; - }; - -}
--- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.h Sat Nov 30 21:53:37 2024 +0100 +++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.h Sat Nov 30 21:57:48 2024 +0100 @@ -23,7 +23,7 @@ #pragma once -#include "BaseDatabaseWrapper.h" +#include "BaseCompatibilityTransaction.h" #include "../../../OrthancFramework/Sources/SQLite/Connection.h" @@ -112,7 +112,7 @@ * "UnitTestsTransaction" give access to additional information * about the underlying SQLite database to be used in unit tests. **/ - class UnitTestsTransaction : public BaseTransaction + class UnitTestsTransaction : public BaseCompatibilityTransaction { protected: SQLite::Connection& db_;