summaryrefslogtreecommitdiff
path: root/ACE/protocols/ace/TMCast/Messaging.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/protocols/ace/TMCast/Messaging.hpp')
-rw-r--r--ACE/protocols/ace/TMCast/Messaging.hpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/ACE/protocols/ace/TMCast/Messaging.hpp b/ACE/protocols/ace/TMCast/Messaging.hpp
new file mode 100644
index 00000000000..a75191f23f0
--- /dev/null
+++ b/ACE/protocols/ace/TMCast/Messaging.hpp
@@ -0,0 +1,53 @@
+// $Id$
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+
+#ifndef TMCAST_MESSAGING_HPP
+#define TMCAST_MESSAGING_HPP
+
+#include <ace/Synch.h>
+#include <ace/Bound_Ptr.h>
+
+#include "MTQueue.hpp"
+
+namespace ACE_TMCast
+{
+ class Message
+ {
+ public:
+ virtual
+ ~Message () {}
+ };
+
+ typedef
+ ACE_Strong_Bound_Ptr<Message, ACE_SYNCH_MUTEX>
+ MessagePtr;
+
+ typedef
+ MTQueue<MessagePtr, ACE_Thread_Mutex, ACE_Condition<ACE_Thread_Mutex> >
+ MessageQueue;
+
+ struct MessageQueueAutoLock
+ {
+ MessageQueueAutoLock (MessageQueue& q)
+ : q_ (q)
+ {
+ q_.lock ();
+ }
+
+ void
+ unlock ()
+ {
+ q_.unlock ();
+ }
+
+ ~MessageQueueAutoLock ()
+ {
+ q_.unlock ();
+ }
+
+ private:
+ MessageQueue& q_;
+ };
+}
+
+#endif // TMCAST_MESSAGING_HPP