comparison 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
comparison
equal deleted inserted replaced
138:f333c0398f6e 139:3ad78369fcc4
1 #include "../Core/IDynamicObject.h"
2
3 #include <gtest/gtest.h>
4 #include <string>
5
6 namespace Orthanc
7 {
8 /**
9 * This class represents a message that is to be sent to some destination.
10 **/
11 class MessageWithDestination : public boost::noncopyable
12 {
13 private:
14 IDynamicObject* message_;
15 std::string destination_;
16
17 public:
18 /**
19 * Create a new message with a destination.
20 * \param message The content of the message (takes the ownership)
21 * \param destination The destination of the message
22 **/
23 MessageWithDestination(IDynamicObject* message,
24 const char* destination)
25 {
26 message_ = message;
27 destination_ = destination;
28 }
29
30 ~MessageWithDestination()
31 {
32 if (message_)
33 {
34 delete message_;
35 }
36 }
37 };
38 }
39
40
41
42 #include "../Core/DicomFormat/DicomString.h"
43
44 using namespace Orthanc;
45
46 TEST(MessageWithDestination, A)
47 {
48 MessageWithDestination a(new DicomString("coucou"), "pukkaj");
49 }
50