Mercurial > hg > orthanc
diff OrthancServer/Sources/Search/DatabaseConstraint.h @ 5680:68fc5af30c03
added container class DatabaseConstraints
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 09 Jul 2024 10:09:57 +0200 |
parents | f7adfb22e20e |
children | 77875b51cf95 |
line wrap: on
line diff
--- a/OrthancServer/Sources/Search/DatabaseConstraint.h Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Search/DatabaseConstraint.h Tue Jul 09 10:09:57 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 { private: ResourceType level_; @@ -148,4 +150,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; + }; }