Mercurial > hg > orthanc-gcp
comparison Plugin/GoogleConfiguration.h @ 0:520cba9a0d42
initial commit
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 13 Jun 2019 14:57:22 +0200 |
parents | |
children | 25292488ff8f |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:520cba9a0d42 |
---|---|
1 /** | |
2 * Google Cloud Platform credentials for DICOMweb and Orthanc | |
3 * Copyright (C) 2019 Osimis S.A., Belgium | |
4 * | |
5 * This program is free software: you can redistribute it and/or | |
6 * modify it under the terms of the GNU General Public License as | |
7 * published by the Free Software Foundation, either version 3 of the | |
8 * License, or (at your option) any later version. | |
9 * | |
10 * In addition, as a special exception, the copyright holders of this | |
11 * program give permission to link the code of its release with the | |
12 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
13 * that use the same license as the "OpenSSL" library), and distribute | |
14 * the linked executables. You must obey the GNU General Public License | |
15 * in all respects for all of the code used other than "OpenSSL". If you | |
16 * modify file(s) with this exception, you may extend this exception to | |
17 * your version of the file(s), but you are not obligated to do so. If | |
18 * you do not wish to do so, delete this exception statement from your | |
19 * version. If you delete this exception statement from all source files | |
20 * in the program, then also delete it here. | |
21 * | |
22 * This program is distributed in the hope that it will be useful, but | |
23 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
25 * General Public License for more details. | |
26 * | |
27 * You should have received a copy of the GNU General Public License | |
28 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
29 **/ | |
30 | |
31 | |
32 | |
33 #pragma once | |
34 | |
35 #include "GoogleAccount.h" | |
36 | |
37 class GoogleConfiguration : public boost::noncopyable | |
38 { | |
39 private: | |
40 std::string caInfo_; | |
41 std::string baseGoogleUrl_; | |
42 std::string dicomWebPluginRoot_; | |
43 std::vector<GoogleAccount*> accounts_; | |
44 unsigned int timeoutSeconds_; | |
45 unsigned int refreshIntervalSeconds_; | |
46 | |
47 GoogleConfiguration(); // Singleton pattern | |
48 | |
49 public: | |
50 ~GoogleConfiguration(); | |
51 | |
52 void Reserve(size_t i) | |
53 { | |
54 accounts_.reserve(i); | |
55 } | |
56 | |
57 void AddAccount(GoogleAccount* account); // Takes ownership | |
58 | |
59 size_t GetAccountsCount() const | |
60 { | |
61 return accounts_.size(); | |
62 } | |
63 | |
64 const GoogleAccount& GetAccount(size_t i) const; | |
65 | |
66 const std::string& GetBaseGoogleUrl() const | |
67 { | |
68 return baseGoogleUrl_; | |
69 } | |
70 | |
71 const std::string& GetDicomWebPluginRoot() const | |
72 { | |
73 return dicomWebPluginRoot_; | |
74 } | |
75 | |
76 unsigned int GetRefreshIntervalSeconds() const | |
77 { | |
78 return refreshIntervalSeconds_; | |
79 } | |
80 | |
81 const std::string& GetCaInfo() const | |
82 { | |
83 return caInfo_; | |
84 } | |
85 | |
86 unsigned int GetTimeoutSeconds() const | |
87 { | |
88 return timeoutSeconds_; | |
89 } | |
90 | |
91 static const GoogleConfiguration& GetInstance(); | |
92 }; |