changeset 1722:f1901004f3e4 db-changes

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 20 Oct 2015 10:41:35 +0200
parents 3bcb01028107
children 40a8445fc81d
files OrthancServer/OrthancRestApi/OrthancRestResources.cpp OrthancServer/ServerIndex.h
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp	Tue Oct 20 10:39:21 2015 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp	Tue Oct 20 10:41:35 2015 +0200
@@ -879,7 +879,13 @@
   }
 
 
-  static void AccumulateLookupResults(ServerIndex::LookupResults& result,
+  namespace
+  {
+    typedef std::list< std::pair<ResourceType, std::string> >  LookupResults;
+  }
+
+
+  static void AccumulateLookupResults(LookupResults& result,
                                       ServerIndex& index,
                                       const DicomTag& tag,
                                       const std::string& value,
@@ -901,7 +907,7 @@
     std::string tag;
     call.BodyToString(tag);
 
-    ServerIndex::LookupResults resources;
+    LookupResults resources;
     ServerIndex& index = OrthancRestApi::GetIndex(call);
     AccumulateLookupResults(resources, index, DICOM_TAG_PATIENT_ID, tag, ResourceType_Patient);
     AccumulateLookupResults(resources, index, DICOM_TAG_STUDY_INSTANCE_UID, tag, ResourceType_Study);
@@ -909,7 +915,7 @@
     AccumulateLookupResults(resources, index, DICOM_TAG_SOP_INSTANCE_UID, tag, ResourceType_Instance);
 
     Json::Value result = Json::arrayValue;    
-    for (ServerIndex::LookupResults::const_iterator 
+    for (LookupResults::const_iterator 
            it = resources.begin(); it != resources.end(); ++it)
     {     
       ResourceType type = it->first;
--- a/OrthancServer/ServerIndex.h	Tue Oct 20 10:39:21 2015 +0200
+++ b/OrthancServer/ServerIndex.h	Tue Oct 20 10:41:35 2015 +0200
@@ -52,7 +52,6 @@
   public:
     typedef std::list<FileInfo> Attachments;
     typedef std::map< std::pair<ResourceType, MetadataType>, std::string>  MetadataMap;
-    typedef std::list< std::pair<ResourceType, std::string> >  LookupResults;
 
   private:
     class Listener;