diff Framework/Oracle/OrthancRestApiCommand.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/OrthancRestApiCommand.h	Wed Nov 06 15:16:45 2019 +0100
+++ b/Framework/Oracle/OrthancRestApiCommand.h	Wed Nov 06 17:34:58 2019 +0100
@@ -36,7 +36,7 @@
   public:
     typedef std::map<std::string, std::string>  HttpHeaders;
 
-    class SuccessMessage : public OracleMessageBase
+    class SuccessMessage : public OriginMessage<OrthancRestApiCommand>
     {
       ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
       
@@ -45,10 +45,10 @@
       const std::string&  answer_;
 
     public:
-      SuccessMessage(OrthancRestApiCommand& command,
+      SuccessMessage(const OrthancRestApiCommand& command,
                      const HttpHeaders& answerHeaders,
                      const std::string& answer) :
-        OracleMessageBase(command),
+        OriginMessage(command),
         headers_(answerHeaders),
         answer_(answer)
       {
@@ -76,6 +76,16 @@
     unsigned int         timeout_;
     bool                 applyPlugins_;  // Only makes sense for Stone as an Orthanc plugin
 
+    OrthancRestApiCommand(const OrthancRestApiCommand& other) :
+      method_(other.method_),
+      uri_(other.uri_),
+      body_(other.body_),
+      headers_(other.headers_),
+      timeout_(other.timeout_),
+      applyPlugins_(other.applyPlugins_)
+    {
+    }
+    
   public:
     OrthancRestApiCommand();
 
@@ -84,6 +94,11 @@
       return Type_OrthancRestApi;
     }
 
+    virtual IOracleCommand* Clone() const
+    {
+      return new OrthancRestApiCommand(*this);
+    }
+
     void SetMethod(Orthanc::HttpMethod method)
     {
       method_ = method;