00001 #include "ace_pch.h"
00002
00003
00004
00005 #ifndef ACE_TASK_T_C
00006 #define ACE_TASK_T_C
00007
00008 #include "ace/Task_T.h"
00009
00010 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00011 # pragma once
00012 #endif
00013
00014 #include "ace/Module.h"
00015
00016
00017 #if !defined (__ACE_INLINE__)
00018 #include "ace/Task_T.i"
00019 #endif
00020
00021 ACE_RCSID(ace, Task_T, "$Id: Task_T.cpp,v 1.1.1.3.64.1 2003/03/13 19:44:22 chad Exp $")
00022
00023 template <ACE_SYNCH_DECL> void
00024 ACE_Task<ACE_SYNCH_USE>::dump (void) const
00025 {
00026 ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::dump");
00027 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00028 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nthr_mgr_ = %x"), this->thr_mgr_));
00029 this->msg_queue_->dump ();
00030 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("delete_msg_queue_ = %d\n"), this->delete_msg_queue_));
00031 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nflags = %x"), this->flags_));
00032 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nmod_ = %x"), this->mod_));
00033 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nnext_ = %x"), this->next_));
00034 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\ngrp_id_ = %d"), this->grp_id_));
00035 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nthr_count_ = %d"), this->thr_count_));
00036 #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
00037 this->lock_.dump ();
00038 #endif
00039
00040 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00041 }
00042
00043
00044
00045
00046 template<ACE_SYNCH_DECL>
00047 ACE_Task<ACE_SYNCH_USE>::ACE_Task (ACE_Thread_Manager *thr_man,
00048 ACE_Message_Queue<ACE_SYNCH_USE> *mq)
00049 : ACE_Task_Base (thr_man),
00050 msg_queue_ (0),
00051 delete_msg_queue_ (0),
00052 mod_ (0),
00053 next_ (0)
00054 {
00055 ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::ACE_Task");
00056
00057 if (mq == 0)
00058 {
00059 ACE_NEW (mq,
00060 ACE_Message_Queue<ACE_SYNCH_USE>);
00061 this->delete_msg_queue_ = 1;
00062 }
00063
00064 this->msg_queue_ = mq;
00065 }
00066
00067 template<ACE_SYNCH_DECL>
00068 ACE_Task<ACE_SYNCH_USE>::~ACE_Task (void)
00069 {
00070 ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::~ACE_Task");
00071 if (this->delete_msg_queue_)
00072 delete this->msg_queue_;
00073
00074
00075
00076 this->delete_msg_queue_ = 0;
00077 }
00078
00079 template<ACE_SYNCH_DECL> ACE_Task<ACE_SYNCH_USE> *
00080 ACE_Task<ACE_SYNCH_USE>::sibling (void)
00081 {
00082 ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::sibling");
00083 if (this->mod_ == 0)
00084 return 0;
00085 else
00086 return this->mod_->sibling (this);
00087 }
00088
00089 template<ACE_SYNCH_DECL> const ACE_TCHAR *
00090 ACE_Task<ACE_SYNCH_USE>::name (void) const
00091 {
00092 ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::name");
00093 if (this->mod_ == 0)
00094 return 0;
00095 else
00096 return this->mod_->name ();
00097 }
00098
00099 template<ACE_SYNCH_DECL> ACE_Module<ACE_SYNCH_USE> *
00100 ACE_Task<ACE_SYNCH_USE>::module (void) const
00101 {
00102 ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::module");
00103 return this->mod_;
00104 }
00105
00106 #endif