diff Framework/Oracle/GetOrthancWebViewerJpegCommand.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 0ca50d275b9a
line wrap: on
line diff
--- a/Framework/Oracle/GetOrthancWebViewerJpegCommand.h	Wed Nov 06 15:16:45 2019 +0100
+++ b/Framework/Oracle/GetOrthancWebViewerJpegCommand.h	Wed Nov 06 17:34:58 2019 +0100
@@ -35,7 +35,7 @@
   public:
     typedef std::map<std::string, std::string>  HttpHeaders;
 
-    class SuccessMessage : public OracleMessageBase
+    class SuccessMessage : public OriginMessage<GetOrthancWebViewerJpegCommand>
     {
       ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
       
@@ -43,9 +43,9 @@
       const Orthanc::ImageAccessor&  image_;
 
     public:
-      SuccessMessage(GetOrthancWebViewerJpegCommand& command,
+      SuccessMessage(const GetOrthancWebViewerJpegCommand& command,
                      const Orthanc::ImageAccessor& image) :
-        OracleMessageBase(command),
+        OriginMessage(command),
         image_(image)
       {
       }
@@ -64,6 +64,16 @@
     unsigned int          timeout_;
     Orthanc::PixelFormat  expectedFormat_;
 
+    GetOrthancWebViewerJpegCommand(const GetOrthancWebViewerJpegCommand& other) :
+      instanceId_(other.instanceId_),
+      frame_(other.frame_),
+      quality_(other.quality_),
+      headers_(other.headers_),
+      timeout_(other.timeout_),
+      expectedFormat_(other.expectedFormat_)
+    {
+    }
+    
   public:
     GetOrthancWebViewerJpegCommand();
 
@@ -72,6 +82,11 @@
       return Type_GetOrthancWebViewerJpeg;
     }
 
+    virtual IOracleCommand* Clone() const
+    {
+      return new GetOrthancWebViewerJpegCommand(*this);
+    }
+
     void SetExpectedPixelFormat(Orthanc::PixelFormat format)
     {
       expectedFormat_ = format;
@@ -134,6 +149,6 @@
 
     void ProcessHttpAnswer(boost::weak_ptr<IObserver> receiver,
                            IMessageEmitter& emitter,
-                           const std::string& answer);
+                           const std::string& answer) const;
   };
 }