Mercurial > hg > orthanc-stone
comparison Framework/Oracle/IOracleCommand.h @ 1135:a0a33e5ea5bb broker
IOracleCommand::Clone()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 06 Nov 2019 17:34:58 +0100 |
parents | 8e3763d1736a |
children | 48befc2bf66d |
comparison
equal
deleted
inserted
replaced
1134:87fbeb823375 | 1135:a0a33e5ea5bb |
---|---|
19 **/ | 19 **/ |
20 | 20 |
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include "../Messages/IMessage.h" | |
25 | |
26 #include <Core/IDynamicObject.h> | 24 #include <Core/IDynamicObject.h> |
27 | |
28 #include <boost/noncopyable.hpp> | |
29 | 25 |
30 namespace OrthancStone | 26 namespace OrthancStone |
31 { | 27 { |
32 class IOracleCommand : public boost::noncopyable | 28 class IOracleCommand : public boost::noncopyable |
33 { | 29 { |
34 public: | 30 public: |
35 class OracleMessageBase : public IMessage | |
36 { | |
37 private: | |
38 IOracleCommand& command_; | |
39 | |
40 public: | |
41 OracleMessageBase(IOracleCommand& command) : | |
42 command_(command) | |
43 { | |
44 } | |
45 | |
46 void AcquireCommandPayload(Orthanc::IDynamicObject* payload) const | |
47 { | |
48 command_.AcquirePayload(payload); | |
49 } | |
50 | |
51 const IOracleCommand& GetCommand() const | |
52 { | |
53 return command_; | |
54 } | |
55 }; | |
56 | |
57 enum Type | 31 enum Type |
58 { | 32 { |
59 Type_GetOrthancImage, | 33 Type_GetOrthancImage, |
60 Type_GetOrthancWebViewerJpeg, | 34 Type_GetOrthancWebViewerJpeg, |
61 Type_Http, | 35 Type_Http, |
69 { | 43 { |
70 } | 44 } |
71 | 45 |
72 virtual Type GetType() const = 0; | 46 virtual Type GetType() const = 0; |
73 | 47 |
74 virtual void AcquirePayload(Orthanc::IDynamicObject* payload) = 0; | 48 // This only clones the command, *not* its possibly associated payload |
75 | 49 virtual IOracleCommand* Clone() const = 0; |
76 virtual bool HasPayload() const = 0; | |
77 | |
78 virtual Orthanc::IDynamicObject& GetPayload() const = 0; | |
79 }; | 50 }; |
80 } | 51 } |