summaryrefslogtreecommitdiff
path: root/ACE/ace/Reactor_Token_T.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/ace/Reactor_Token_T.cpp')
-rw-r--r--ACE/ace/Reactor_Token_T.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/ACE/ace/Reactor_Token_T.cpp b/ACE/ace/Reactor_Token_T.cpp
new file mode 100644
index 00000000000..358b0b14f65
--- /dev/null
+++ b/ACE/ace/Reactor_Token_T.cpp
@@ -0,0 +1,70 @@
+// $Id$
+
+#include "ace/Log_Msg.h"
+#include "ace/Reactor_Token_T.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class ACE_TOKEN_TYPE> void
+ACE_Reactor_Token_T<ACE_TOKEN_TYPE>::dump (void) const
+{
+#if defined (ACE_HAS_DUMP)
+ ACE_TRACE ("ACE_Reactor_Token_T::dump");
+
+ ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
+ ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\n")));
+ ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
+#endif /* ACE_HAS_DUMP */
+}
+
+template <class ACE_TOKEN_TYPE>
+ACE_Reactor_Token_T<ACE_TOKEN_TYPE>::ACE_Reactor_Token_T
+ (ACE_Reactor_Impl &r,
+ int s_queue)
+ : reactor_ (&r)
+{
+ ACE_TRACE ("ACE_Reactor_Token_T::ACE_Reactor_Token");
+
+ this->queueing_strategy (s_queue);
+}
+
+template <class ACE_TOKEN_TYPE>
+ACE_Reactor_Token_T<ACE_TOKEN_TYPE>::ACE_Reactor_Token_T (int s_queue)
+ : reactor_ (0)
+{
+ ACE_TRACE ("ACE_Reactor_Token_T::ACE_Reactor_Token");
+
+ this->queueing_strategy (s_queue);
+}
+
+template <class ACE_TOKEN_TYPE>
+ACE_Reactor_Token_T<ACE_TOKEN_TYPE>::~ACE_Reactor_Token_T (void)
+{
+ ACE_TRACE ("ACE_Reactor_Token_T::~ACE_Reactor_Token_T");
+}
+
+template <class ACE_TOKEN_TYPE> ACE_Reactor_Impl &
+ACE_Reactor_Token_T<ACE_TOKEN_TYPE>::reactor (void)
+{
+ return *this->reactor_;
+}
+
+template <class ACE_TOKEN_TYPE> void
+ACE_Reactor_Token_T<ACE_TOKEN_TYPE>::reactor (ACE_Reactor_Impl &reactor)
+{
+ this->reactor_ = &reactor;
+}
+
+// Used to wakeup the reactor.
+
+template <class ACE_TOKEN_TYPE> void
+ACE_Reactor_Token_T<ACE_TOKEN_TYPE>::sleep_hook (void)
+{
+ ACE_TRACE ("ACE_Reactor_Token_T::sleep_hook");
+ if (this->reactor_->notify () == -1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("%p\n"),
+ ACE_LIB_TEXT ("sleep_hook failed")));
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL