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