annotate Framework/Loaders/WebAssemblyLoadersContext.h @ 1313:f30905f5d246 broker

Added support for OnGenericSdlEvent to GuiAdapter. This makes it possible to piggyback app-specific logic to special events (here, to support the Viewport refresh events)
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 16 Mar 2020 11:12:39 +0100
parents 0ca50d275b9a
children cbfdba08e039
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1248
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1271
0ca50d275b9a upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1248
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
1248
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "ILoadersContext.h"
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "../Oracle/WebAssemblyOracle.h"
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "OracleScheduler.h"
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 namespace OrthancStone
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 class WebAssemblyLoadersContext : public ILoadersContext
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 {
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 private:
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 class Locker;
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 WebAssemblyOracle oracle_;
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 boost::shared_ptr<OracleScheduler> scheduler_;
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 std::list< boost::shared_ptr<IObserver> > loaders_;
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 public:
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 WebAssemblyLoadersContext(unsigned int maxHighPriority,
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 unsigned int maxStandardPriority,
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 unsigned int maxLowPriority);
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 void SetLocalOrthanc(const std::string& root)
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 {
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 oracle_.SetLocalOrthanc(root);
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 }
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 void SetRemoteOrthanc(const Orthanc::WebServiceParameters& orthanc)
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 oracle_.SetRemoteOrthanc(orthanc);
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 void SetDicomCacheSize(size_t size)
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 {
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 oracle_.SetDicomCacheSize(size);
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 }
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 virtual ILock* Lock() ORTHANC_OVERRIDE;
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 };
2a8359503f3b WebAssemblyLoadersContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 }