Task_T.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Task_T.inl,v 4.2 2005/10/28 23:55:10 ossama Exp
00004 
00005 #include "ace/os_include/os_assert.h"
00006 
00007 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00008 
00009 template <ACE_SYNCH_DECL> ACE_INLINE void
00010 ACE_Task<ACE_SYNCH_USE>::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
00011                                     size_t wm_size)
00012 {
00013   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::water_marks");
00014   if (cmd == ACE_IO_Cntl_Msg::SET_LWM)
00015     this->msg_queue_->low_water_mark (wm_size);
00016   else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */
00017     this->msg_queue_->high_water_mark (wm_size);
00018 }
00019 
00020 template <ACE_SYNCH_DECL> ACE_INLINE int
00021 ACE_Task<ACE_SYNCH_USE>::getq (ACE_Message_Block *&mb, ACE_Time_Value *tv)
00022 {
00023   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::getq");
00024   return this->msg_queue_->dequeue_head (mb, tv);
00025 }
00026 
00027 template <ACE_SYNCH_DECL> ACE_INLINE int
00028 ACE_Task<ACE_SYNCH_USE>::can_put (ACE_Message_Block *)
00029 {
00030   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::can_put");
00031   assert (!"not implemented");
00032   return -1;
00033 }
00034 
00035 template <ACE_SYNCH_DECL> ACE_INLINE int
00036 ACE_Task<ACE_SYNCH_USE>::putq (ACE_Message_Block *mb, ACE_Time_Value *tv)
00037 {
00038   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::putq");
00039   return this->msg_queue_->enqueue_tail (mb, tv);
00040 }
00041 
00042 template <ACE_SYNCH_DECL> ACE_INLINE int
00043 ACE_Task<ACE_SYNCH_USE>::ungetq (ACE_Message_Block *mb, ACE_Time_Value *tv)
00044 {
00045   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::ungetq");
00046   return this->msg_queue_->enqueue_head (mb, tv);
00047 }
00048 
00049 template <ACE_SYNCH_DECL> ACE_INLINE int
00050 ACE_Task<ACE_SYNCH_USE>::flush (u_long flag)
00051 {
00052   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::flush");
00053   if (ACE_BIT_ENABLED (flag, ACE_Task_Flags::ACE_FLUSHALL))
00054     return this->msg_queue_ != 0 && this->msg_queue_->close ();
00055   else
00056     return -1;   // Note, need to be more careful about what we free...
00057 }
00058 
00059 template <ACE_SYNCH_DECL> ACE_INLINE void
00060 ACE_Task<ACE_SYNCH_USE>::msg_queue (ACE_Message_Queue<ACE_SYNCH_USE> *mq)
00061 {
00062   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::msg_queue");
00063   if (this->delete_msg_queue_)
00064     {
00065       delete this->msg_queue_;
00066       this->delete_msg_queue_ = 0;
00067     }
00068   this->msg_queue_ = mq;
00069 }
00070 
00071 template <ACE_SYNCH_DECL> ACE_Message_Queue<ACE_SYNCH_USE> *
00072 ACE_Task<ACE_SYNCH_USE>::msg_queue (void)
00073 {
00074   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::msg_queue");
00075   return this->msg_queue_;
00076 }
00077 
00078 template <ACE_SYNCH_DECL> ACE_INLINE int
00079 ACE_Task<ACE_SYNCH_USE>::reply (ACE_Message_Block *mb, ACE_Time_Value *tv)
00080 {
00081   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::reply");
00082   return this->sibling ()->put_next (mb, tv);
00083 }
00084 
00085 template <ACE_SYNCH_DECL> ACE_INLINE ACE_Task<ACE_SYNCH_USE> *
00086 ACE_Task<ACE_SYNCH_USE>::next (void)
00087 {
00088   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::next");
00089   return this->next_;
00090 }
00091 
00092 template <ACE_SYNCH_DECL> ACE_INLINE void
00093 ACE_Task<ACE_SYNCH_USE>::next (ACE_Task<ACE_SYNCH_USE> *q)
00094 {
00095   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::next");
00096   this->next_ = q;
00097 }
00098 
00099 // Transfer msg to the next ACE_Task.
00100 
00101 template <ACE_SYNCH_DECL> ACE_INLINE int
00102 ACE_Task<ACE_SYNCH_USE>::put_next (ACE_Message_Block *msg, ACE_Time_Value *tv)
00103 {
00104   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::put_next");
00105   return this->next_ == 0 ? -1 : this->next_->put (msg, tv);
00106 }
00107 
00108 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 09:42:06 2006 for ACE by doxygen 1.3.6