diff OrthancServer/Sources/ServerIndex.cpp @ 4561:02510325d869 db-changes

removed function wrappers for transactions in ServerIndex
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Mar 2021 18:45:48 +0100
parents 929409e40008
children e19f11e08226
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerIndex.cpp	Thu Mar 04 18:42:25 2021 +0100
+++ b/OrthancServer/Sources/ServerIndex.cpp	Thu Mar 04 18:45:48 2021 +0100
@@ -2325,44 +2325,6 @@
   }
   
 
-  class ServerIndex::ReadOnlyWrapper : public IReadOnlyOperations
-  {
-  private:
-    ReadOnlyFunction  func_;
-
-  public:
-    explicit ReadOnlyWrapper(ReadOnlyFunction  func) :
-      func_(func)
-    {
-      assert(func_ != NULL);
-    }
-
-    virtual void Apply(ReadOnlyTransaction& transaction) ORTHANC_OVERRIDE
-    {
-      func_(transaction);
-    }
-  };
-
-  
-  class ServerIndex::ReadWriteWrapper : public IReadWriteOperations
-  {
-  private:
-    ReadWriteFunction  func_;
-
-  public:
-    explicit ReadWriteWrapper(ReadWriteFunction  func) :
-      func_(func)
-    {
-      assert(func_ != NULL);
-    }
-
-    virtual void Apply(ReadWriteTransaction& transaction) ORTHANC_OVERRIDE
-    {
-      func_(transaction);
-    }
-  };
-
-
   void ServerIndex::ApplyInternal(IReadOnlyOperations* readOperations,
                                   IReadWriteOperations* writeOperations)
   {
@@ -2431,29 +2393,19 @@
       }
     }
   }
+
   
   void ServerIndex::Apply(IReadOnlyOperations& operations)
   {
     ApplyInternal(&operations, NULL);
   }
   
+
   void ServerIndex::Apply(IReadWriteOperations& operations)
   {
     ApplyInternal(NULL, &operations);
   }
   
-  void ServerIndex::Apply(ReadOnlyFunction func)
-  {
-    ReadOnlyWrapper wrapper(func);
-    Apply(wrapper);
-  }
-  
-  void ServerIndex::Apply(ReadWriteFunction func)
-  {
-    ReadWriteWrapper wrapper(func);
-    Apply(wrapper);
-  }
-
 
   bool ServerIndex::ExpandResource(Json::Value& target,
                                    const std::string& publicId,