Mercurial > hg > orthanc
comparison PalantirServer/DicomProtocol/DicomServer.h @ 0:3959d33612cc
initial commit
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 19 Jul 2012 14:32:22 +0200 |
parents | |
children | 67a6978503b7 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3959d33612cc |
---|---|
1 /** | |
2 * Palantir - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012 Medical Physics Department, CHU of Liege, | |
4 * Belgium | |
5 * | |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, but | |
12 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 * General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 **/ | |
19 | |
20 | |
21 #pragma once | |
22 | |
23 #include "IFindRequestHandlerFactory.h" | |
24 #include "IMoveRequestHandlerFactory.h" | |
25 #include "IStoreRequestHandlerFactory.h" | |
26 #include "IApplicationEntityFilter.h" | |
27 #include "../../Core/MultiThreading/BagOfRunnablesBySteps.h" | |
28 | |
29 #include <boost/shared_ptr.hpp> | |
30 #include <boost/noncopyable.hpp> | |
31 | |
32 namespace Palantir | |
33 { | |
34 class DicomServer : public boost::noncopyable | |
35 { | |
36 private: | |
37 struct PImpl; | |
38 boost::shared_ptr<PImpl> pimpl_; | |
39 | |
40 bool checkCalledAet_; | |
41 std::string aet_; | |
42 uint16_t port_; | |
43 bool continue_; | |
44 bool started_; | |
45 uint32_t clientTimeout_; | |
46 bool isThreaded_; | |
47 IFindRequestHandlerFactory* findRequestHandlerFactory_; | |
48 IMoveRequestHandlerFactory* moveRequestHandlerFactory_; | |
49 IStoreRequestHandlerFactory* storeRequestHandlerFactory_; | |
50 IApplicationEntityFilter* applicationEntityFilter_; | |
51 | |
52 BagOfRunnablesBySteps bagOfDispatchers_; // This is used iff the server is threaded | |
53 | |
54 static void ServerThread(DicomServer* server); | |
55 | |
56 public: | |
57 DicomServer(); | |
58 | |
59 ~DicomServer(); | |
60 | |
61 void SetPort(uint16_t port); | |
62 uint16_t GetPort() const; | |
63 | |
64 void SetThreaded(bool isThreaded); | |
65 bool IsThreaded() const; | |
66 | |
67 void SetClientTimeout(uint32_t timeout); | |
68 uint32_t GetClientTimeout() const; | |
69 | |
70 void SetCalledApplicationEntityTitleCheck(bool check); | |
71 bool HasCalledApplicationEntityTitleCheck() const; | |
72 | |
73 void SetApplicationEntityTitle(const std::string& aet); | |
74 const std::string& GetApplicationEntityTitle() const; | |
75 | |
76 void SetFindRequestHandlerFactory(IFindRequestHandlerFactory& handler); | |
77 bool HasFindRequestHandlerFactory() const; | |
78 IFindRequestHandlerFactory& GetFindRequestHandlerFactory() const; | |
79 | |
80 void SetMoveRequestHandlerFactory(IMoveRequestHandlerFactory& handler); | |
81 bool HasMoveRequestHandlerFactory() const; | |
82 IMoveRequestHandlerFactory& GetMoveRequestHandlerFactory() const; | |
83 | |
84 void SetStoreRequestHandlerFactory(IStoreRequestHandlerFactory& handler); | |
85 bool HasStoreRequestHandlerFactory() const; | |
86 IStoreRequestHandlerFactory& GetStoreRequestHandlerFactory() const; | |
87 | |
88 void SetApplicationEntityFilter(IApplicationEntityFilter& handler); | |
89 bool HasApplicationEntityFilter() const; | |
90 IApplicationEntityFilter& GetApplicationEntityFilter() const; | |
91 | |
92 void Start(); | |
93 | |
94 void Stop(); | |
95 }; | |
96 | |
97 } |