Mercurial > hg > orthanc-stone
annotate Framework/Toolbox/OrthancAsynchronousWebService.h @ 79:4e21f6b3aa0d wasm
cleaning up
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 24 May 2017 21:23:29 +0200 |
parents | f73aed014bde |
children | f40a78cc7070 |
rev | line source |
---|---|
70
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2017 Osimis, Belgium |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Affero General Public License |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * the License, or (at your option) any later version. |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * Affero General Public License for more details. |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Affero General Public License |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 **/ |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 #pragma once |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #include "IWebService.h" |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 #include "../../Resources/Orthanc/Plugins/Samples/Common/IOrthancConnection.h" |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 #include "../../Resources/Orthanc/Core/WebServiceParameters.h" |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 #include <boost/shared_ptr.hpp> |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 namespace OrthancStone |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 { |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 class OrthancAsynchronousWebService : public IWebService |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 { |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 private: |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 class PendingRequest; |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 class PImpl; |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 boost::shared_ptr<PImpl> pimpl_; |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 public: |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 OrthancAsynchronousWebService(const Orthanc::WebServiceParameters& parameters, |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 unsigned int threadCount); |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 virtual void ScheduleGetRequest(ICallback& callback, |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 const std::string& uri, |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 Orthanc::IDynamicObject* payload); |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 virtual void SchedulePostRequest(ICallback& callback, |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 const std::string& uri, |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 const std::string& body, |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 Orthanc::IDynamicObject* payload); |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 virtual void Start(); |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 virtual void Stop(); |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 }; |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 } |