summaryrefslogtreecommitdiff
path: root/ace/Activation_Queue.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-10-21 21:41:34 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-10-21 21:41:34 +0000
commita5fdebc5f6375078ec1763850a4ca23ec7fe6458 (patch)
treebcf0a25c3d45a209a6e3ac37b233a4812f29c732 /ace/Activation_Queue.cpp
downloadATCD-a5fdebc5f6375078ec1763850a4ca23ec7fe6458.tar.gz
Initial revision
Diffstat (limited to 'ace/Activation_Queue.cpp')
-rw-r--r--ace/Activation_Queue.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/ace/Activation_Queue.cpp b/ace/Activation_Queue.cpp
new file mode 100644
index 00000000000..e536bfb030f
--- /dev/null
+++ b/ace/Activation_Queue.cpp
@@ -0,0 +1,70 @@
+// Activation_Queue.cpp
+// $Id$
+
+#define ACE_BUILD_DLL
+
+#include "ace/Activation_Queue.h"
+
+// Dump the state of an object.
+
+void
+ACE_Activation_Queue::dump (void) const
+{
+ ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
+ ACE_DEBUG ((LM_DEBUG,
+ "delete_queue_ = %d\n",
+ this->delete_queue_));
+ ACE_DEBUG ((LM_INFO,"queue_: \n"));
+ if (this->queue_)
+ this->queue_->dump();
+ else
+ ACE_DEBUG ((LM_DEBUG,"(NULL)\n"));
+ ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
+}
+
+ACE_Activation_Queue::ACE_Activation_Queue (ACE_Message_Queue<ACE_SYNCH> *new_queue)
+ : delete_queue_ (0)
+{
+ if (new_queue)
+ this->queue_ = new_queue;
+ else
+ {
+ ACE_NEW (this->queue_, ACE_Message_Queue<ACE_SYNCH>);
+ this->delete_queue_ = 1;
+ }
+}
+
+ACE_Activation_Queue::~ACE_Activation_Queue (void)
+{
+ if (this->delete_queue_ != 0)
+ delete this->queue_;
+}
+
+ACE_Method_Object *
+ACE_Activation_Queue::dequeue (ACE_Time_Value *tv)
+{
+ ACE_Message_Block *mb;
+ ACE_Method_Object *mo;
+
+ // Dequeue the message.
+ this->queue_->dequeue_head (mb, tv);
+
+ // Get the method object.
+ mo = (ACE_Method_Object *) mb->base ();
+
+ // Delete the message block.
+ delete mb;
+ return mo;
+}
+
+int
+ACE_Activation_Queue::enqueue (ACE_Method_Object *mo,
+ ACE_Time_Value *tv)
+{
+ ACE_Message_Block *mb;
+
+ ACE_NEW_RETURN (mb, ACE_Message_Block ((char *) mo), -1);
+
+ return this->queue_->enqueue (mb, tv);
+}
+