comparison Framework/Oracle/GetOrthancImageCommand.h @ 1135:a0a33e5ea5bb broker

IOracleCommand::Clone()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 06 Nov 2019 17:34:58 +0100
parents 87fbeb823375
children 78b8bfe154bc
comparison
equal deleted inserted replaced
1134:87fbeb823375 1135:a0a33e5ea5bb
33 class GetOrthancImageCommand : public OracleCommandBase 33 class GetOrthancImageCommand : public OracleCommandBase
34 { 34 {
35 public: 35 public:
36 typedef std::map<std::string, std::string> HttpHeaders; 36 typedef std::map<std::string, std::string> HttpHeaders;
37 37
38 class SuccessMessage : public OracleMessageBase 38 class SuccessMessage : public OriginMessage<GetOrthancImageCommand>
39 { 39 {
40 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); 40 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
41 41
42 private: 42 private:
43 const Orthanc::ImageAccessor& image_; 43 const Orthanc::ImageAccessor& image_;
44 Orthanc::MimeType mime_; 44 Orthanc::MimeType mime_;
45 45
46 public: 46 public:
47 SuccessMessage(GetOrthancImageCommand& command, 47 SuccessMessage(const GetOrthancImageCommand& command,
48 const Orthanc::ImageAccessor& image, 48 const Orthanc::ImageAccessor& image,
49 Orthanc::MimeType mime) : 49 Orthanc::MimeType mime) :
50 OracleMessageBase(command), 50 OriginMessage(command),
51 image_(image), 51 image_(image),
52 mime_(mime) 52 mime_(mime)
53 { 53 {
54 } 54 }
55 55
70 HttpHeaders headers_; 70 HttpHeaders headers_;
71 unsigned int timeout_; 71 unsigned int timeout_;
72 bool hasExpectedFormat_; 72 bool hasExpectedFormat_;
73 Orthanc::PixelFormat expectedFormat_; 73 Orthanc::PixelFormat expectedFormat_;
74 74
75 GetOrthancImageCommand(const GetOrthancImageCommand& other) :
76 uri_(other.uri_),
77 headers_(other.headers_),
78 timeout_(other.timeout_),
79 hasExpectedFormat_(other.hasExpectedFormat_),
80 expectedFormat_(other.expectedFormat_)
81 {
82 }
83
75 public: 84 public:
76 GetOrthancImageCommand(); 85 GetOrthancImageCommand();
77 86
78 virtual Type GetType() const 87 virtual Type GetType() const
79 { 88 {
80 return Type_GetOrthancImage; 89 return Type_GetOrthancImage;
90 }
91
92 virtual IOracleCommand* Clone() const
93 {
94 return new GetOrthancImageCommand(*this);
81 } 95 }
82 96
83 void SetExpectedPixelFormat(Orthanc::PixelFormat format); 97 void SetExpectedPixelFormat(Orthanc::PixelFormat format);
84 98
85 void SetUri(const std::string& uri) 99 void SetUri(const std::string& uri)
117 } 131 }
118 132
119 void ProcessHttpAnswer(boost::weak_ptr<IObserver> receiver, 133 void ProcessHttpAnswer(boost::weak_ptr<IObserver> receiver,
120 IMessageEmitter& emitter, 134 IMessageEmitter& emitter,
121 const std::string& answer, 135 const std::string& answer,
122 const HttpHeaders& answerHeaders); 136 const HttpHeaders& answerHeaders) const;
123 }; 137 };
124 } 138 }