changeset 5722:3fd4d5833c55 find-refactoring-clean

removed StatelessDatabaseOperations::ApplyLookupResources()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 19 Jul 2024 10:09:08 +0200
parents 3f97590cc0c9
children e63538a6d9de
files OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp OrthancServer/Sources/Database/StatelessDatabaseOperations.h
diffstat 2 files changed, 0 insertions(+), 79 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp	Fri Jul 19 10:06:39 2024 +0200
+++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp	Fri Jul 19 10:09:08 2024 +0200
@@ -1564,77 +1564,6 @@
   }
 
 
-  void StatelessDatabaseOperations::ApplyLookupResources(std::vector<std::string>& resourcesId,
-                                                         std::vector<std::string>* instancesId,
-                                                         const DatabaseLookup& lookup,
-                                                         ResourceType queryLevel,
-                                                         const std::set<std::string>& labels,
-                                                         LabelsConstraint labelsConstraint,
-                                                         uint32_t limit)
-  {
-    class Operations : public ReadOnlyOperationsT6<bool, const DatabaseConstraints&, ResourceType,
-                                                   const std::set<std::string>&, LabelsConstraint, size_t>
-    {
-    private:
-      std::list<std::string>  resourcesList_;
-      std::list<std::string>  instancesList_;
-      
-    public:
-      const std::list<std::string>& GetResourcesList() const
-      {
-        return resourcesList_;
-      }
-
-      const std::list<std::string>& GetInstancesList() const
-      {
-        return instancesList_;
-      }
-
-      virtual void ApplyTuple(ReadOnlyTransaction& transaction,
-                              const Tuple& tuple) ORTHANC_OVERRIDE
-      {
-        // TODO - CANDIDATE FOR "TransactionType_Implicit"
-        if (tuple.get<0>())
-        {
-          transaction.ApplyLookupResources(
-            resourcesList_, &instancesList_, tuple.get<1>(), tuple.get<2>(), tuple.get<3>(), tuple.get<4>(), tuple.get<5>());
-        }
-        else
-        {
-          transaction.ApplyLookupResources(
-            resourcesList_, NULL, tuple.get<1>(), tuple.get<2>(), tuple.get<3>(), tuple.get<4>(), tuple.get<5>());
-        }
-      }
-    };
-
-    if (!labels.empty() &&
-        !db_.GetDatabaseCapabilities().HasLabelsSupport())
-    {
-      throw OrthancException(ErrorCode_NotImplemented, "The database backend doesn't support labels");
-    }
-
-    for (std::set<std::string>::const_iterator it = labels.begin(); it != labels.end(); ++it)
-    {
-      ServerToolbox::CheckValidLabel(*it);
-    }
-
-    DatabaseConstraints normalized;
-
-    assert(mainDicomTagsRegistry_.get() != NULL);
-    mainDicomTagsRegistry_->NormalizeLookup(normalized, lookup, queryLevel);
-
-    Operations operations;
-    operations.Apply(*this, (instancesId != NULL), normalized, queryLevel, labels, labelsConstraint, limit);
-    
-    CopyListToVector(resourcesId, operations.GetResourcesList());
-
-    if (instancesId != NULL)
-    { 
-      CopyListToVector(*instancesId, operations.GetInstancesList());
-    }
-  }
-
-
   bool StatelessDatabaseOperations::DeleteResource(Json::Value& remainingAncestor,
                                                    const std::string& uuid,
                                                    ResourceType expectedType)
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.h	Fri Jul 19 10:06:39 2024 +0200
+++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.h	Fri Jul 19 10:09:08 2024 +0200
@@ -625,14 +625,6 @@
                       const std::string& publicId,
                       ResourceType parentType);
 
-    void ApplyLookupResources(std::vector<std::string>& resourcesId,
-                              std::vector<std::string>* instancesId,  // Can be NULL if not needed
-                              const DatabaseLookup& lookup,
-                              ResourceType queryLevel,
-                              const std::set<std::string>& labels,
-                              LabelsConstraint labelsConstraint,
-                              uint32_t limit);
-
     bool DeleteResource(Json::Value& remainingAncestor /* out */,
                         const std::string& uuid,
                         ResourceType expectedType);