# HG changeset patch # User Sebastien Jodogne # Date 1679681400 -3600 # Node ID 6d8647122ef3b06d6a2657b1e0e5291fa8829bab # Parent 48005e522bd683008d2b6730fc6a36e220b14b65 cont diff -r 48005e522bd6 -r 6d8647122ef3 OrthancFramework/Sources/DicomFormat/DicomMap.cpp --- a/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Fri Mar 24 19:00:33 2023 +0100 +++ b/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Fri Mar 24 19:10:00 2023 +0100 @@ -257,14 +257,14 @@ return allMainDicomTags_; } - const std::string& GetMainDicomTagsSignature(ResourceType level) + std::string GetMainDicomTagsSignature(ResourceType level) { assert(signatures_.find(level) != signatures_.end()); return signatures_[level]; } - const std::string& GetDefaultMainDicomTagsSignature(ResourceType level) + std::string GetDefaultMainDicomTagsSignature(ResourceType level) { assert(defaultSignatures_.find(level) != defaultSignatures_.end()); @@ -707,9 +707,9 @@ target = DicomMap::MainDicomTagsConfiguration::GetInstance().GetMainDicomTagsByLevel(level); } - const std::set& DicomMap::GetAllMainDicomTags() + void DicomMap::GetAllMainDicomTags(std::set& target) { - return DicomMap::MainDicomTagsConfiguration::GetInstance().GetAllMainDicomTags(); + target = DicomMap::MainDicomTagsConfiguration::GetInstance().GetAllMainDicomTags(); } void DicomMap::AddMainDicomTag(const DicomTag& tag, ResourceType level) @@ -722,12 +722,12 @@ DicomMap::MainDicomTagsConfiguration::GetInstance().ResetDefaultMainDicomTags(); } - const std::string& DicomMap::GetMainDicomTagsSignature(ResourceType level) + std::string DicomMap::GetMainDicomTagsSignature(ResourceType level) { return DicomMap::MainDicomTagsConfiguration::GetInstance().GetMainDicomTagsSignature(level); } - const std::string& DicomMap::GetDefaultMainDicomTagsSignature(ResourceType level) + std::string DicomMap::GetDefaultMainDicomTagsSignature(ResourceType level) { return DicomMap::MainDicomTagsConfiguration::GetInstance().GetDefaultMainDicomTagsSignature(level); } diff -r 48005e522bd6 -r 6d8647122ef3 OrthancFramework/Sources/DicomFormat/DicomMap.h --- a/OrthancFramework/Sources/DicomFormat/DicomMap.h Fri Mar 24 19:00:33 2023 +0100 +++ b/OrthancFramework/Sources/DicomFormat/DicomMap.h Fri Mar 24 19:10:00 2023 +0100 @@ -158,11 +158,11 @@ ResourceType level); // returns a string uniquely identifying the list of main dicom tags for a level - static const std::string& GetMainDicomTagsSignature(ResourceType level); + static std::string GetMainDicomTagsSignature(ResourceType level); - static const std::string& GetDefaultMainDicomTagsSignature(ResourceType level); + static std::string GetDefaultMainDicomTagsSignature(ResourceType level); - static const std::set& GetAllMainDicomTags(); + static void GetAllMainDicomTags(std::set& target); // adds a main dicom tag to the definition of main dicom tags for each level. // this should be done once at startup before you use MainDicomTags methods diff -r 48005e522bd6 -r 6d8647122ef3 OrthancFramework/UnitTestsSources/DicomMapTests.cpp --- a/OrthancFramework/UnitTestsSources/DicomMapTests.cpp Fri Mar 24 19:00:33 2023 +0100 +++ b/OrthancFramework/UnitTestsSources/DicomMapTests.cpp Fri Mar 24 19:10:00 2023 +0100 @@ -81,7 +81,8 @@ ASSERT_TRUE(DicomMap::IsMainDicomTag(DICOM_TAG_SOP_INSTANCE_UID)); { - const std::set& s = DicomMap::GetAllMainDicomTags(); + std::set s; + DicomMap::GetAllMainDicomTags(s); ASSERT_TRUE(s.end() != s.find(DICOM_TAG_PATIENT_ID)); ASSERT_TRUE(s.end() != s.find(DICOM_TAG_STUDY_INSTANCE_UID)); ASSERT_TRUE(s.end() != s.find(DICOM_TAG_ACCESSION_NUMBER)); diff -r 48005e522bd6 -r 6d8647122ef3 OrthancServer/Sources/Search/DatabaseLookup.cpp --- a/OrthancServer/Sources/Search/DatabaseLookup.cpp Fri Mar 24 19:00:33 2023 +0100 +++ b/OrthancServer/Sources/Search/DatabaseLookup.cpp Fri Mar 24 19:10:00 2023 +0100 @@ -281,7 +281,8 @@ bool DatabaseLookup::HasOnlyMainDicomTags() const { - const std::set& allMainTags = DicomMap::GetAllMainDicomTags(); + std::set allMainTags; + DicomMap::GetAllMainDicomTags(allMainTags); for (size_t i = 0; i < constraints_.size(); i++) { diff -r 48005e522bd6 -r 6d8647122ef3 OrthancServer/Sources/ServerContext.cpp --- a/OrthancServer/Sources/ServerContext.cpp Fri Mar 24 19:00:33 2023 +0100 +++ b/OrthancServer/Sources/ServerContext.cpp Fri Mar 24 19:10:00 2023 +0100 @@ -551,7 +551,8 @@ DicomMap summary; dicom.GetSummary(summary); // -> from Orthanc 1.11.1, this includes the leaf nodes and sequences - std::set allMainDicomTags = DicomMap::GetAllMainDicomTags(); + std::set allMainDicomTags; + DicomMap::GetAllMainDicomTags(allMainDicomTags); try {