diff OrthancServer/Sources/Search/DatabaseConstraint.h @ 5681:77875b51cf95 find-refactoring

integration mainline->find-refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 09 Jul 2024 10:15:15 +0200
parents 3f13db27b399 68fc5af30c03
children fd4c5e064cbe
line wrap: on
line diff
--- a/OrthancServer/Sources/Search/DatabaseConstraint.h	Tue Jul 09 09:03:40 2024 +0200
+++ b/OrthancServer/Sources/Search/DatabaseConstraint.h	Tue Jul 09 10:15:15 2024 +0200
@@ -46,6 +46,8 @@
 #  endif
 #endif
 
+#include <deque>
+
 namespace Orthanc
 {
   enum ConstraintType
@@ -78,7 +80,7 @@
 
 
   // This class is also used by the "orthanc-databases" project
-  class DatabaseConstraint
+  class DatabaseConstraint : public boost::noncopyable
   {
   public:
     enum KeyType  // used for ordering and filters
@@ -157,4 +159,33 @@
                           std::vector<const char*>& tmpValues) const;
 #endif    
   };
+
+
+  class DatabaseConstraints : public boost::noncopyable
+  {
+  private:
+    std::deque<DatabaseConstraint*>  constraints_;
+
+  public:
+    ~DatabaseConstraints()
+    {
+      Clear();
+    }
+
+    void Clear();
+
+    void AddConstraint(DatabaseConstraint* constraint);  // Takes ownership
+
+    bool IsEmpty() const
+    {
+      return constraints_.empty();
+    }
+
+    size_t GetSize() const
+    {
+      return constraints_.size();
+    }
+
+    const DatabaseConstraint& GetConstraint(size_t index) const;
+  };
 }