diff UnitTests/MessageWithDestination.cpp @ 139:3ad78369fcc4

start threaded messages
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Oct 2012 17:57:03 +0200
parents
children 4d863c7b2f44
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/UnitTests/MessageWithDestination.cpp	Wed Oct 10 17:57:03 2012 +0200
@@ -0,0 +1,50 @@
+#include "../Core/IDynamicObject.h"
+
+#include <gtest/gtest.h>
+#include <string>
+
+namespace Orthanc
+{
+  /**
+   * This class represents a message that is to be sent to some destination.
+   **/
+  class MessageWithDestination : public boost::noncopyable
+  {
+  private:
+    IDynamicObject* message_;
+    std::string destination_;
+
+  public:
+    /**
+     * Create a new message with a destination.
+     * \param message The content of the message (takes the ownership)
+     * \param destination The destination of the message
+     **/
+    MessageWithDestination(IDynamicObject* message,
+                           const char* destination)
+    {
+      message_ = message;
+      destination_ = destination;
+    }
+
+    ~MessageWithDestination()
+    {
+      if (message_)
+      {
+        delete message_;
+      }
+    }
+  };
+}
+
+
+
+#include "../Core/DicomFormat/DicomString.h"
+
+using namespace Orthanc;
+
+TEST(MessageWithDestination, A)
+{
+  MessageWithDestination a(new DicomString("coucou"), "pukkaj");
+}
+