annotate OrthancServer/Sources/Search/DatabaseConstraints.h @ 5770:e2771185dad6 find-refactoring

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 09 Sep 2024 16:43:47 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5770
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * License, or (at your option) any later version.
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * General Public License for more details.
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "DatabaseConstraint.h"
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #include <deque>
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 namespace Orthanc
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 {
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 class DatabaseConstraints : public boost::noncopyable
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 private:
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 std::deque<DatabaseConstraint*> constraints_;
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 public:
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 ~DatabaseConstraints()
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 {
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 Clear();
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 }
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 void Clear();
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 void AddConstraint(DatabaseConstraint* constraint); // Takes ownership
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 bool IsEmpty() const
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 return constraints_.empty();
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 }
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 size_t GetSize() const
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 {
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 return constraints_.size();
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 }
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 const DatabaseConstraint& GetConstraint(size_t index) const;
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 std::string Format() const;
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 };
e2771185dad6 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 }