Task_T.inl

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

Generated on Tue Feb 2 17:18:43 2010 for ACE by  doxygen 1.4.7