/* -*- C++ -*- */ // $Id: Task_T.i,v 1.1.1.2 2001/12/04 14:33:10 chad Exp $ // Task_T.i template ACE_INLINE void ACE_Task::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, size_t wm_size) { ACE_TRACE ("ACE_Task::water_marks"); if (cmd == ACE_IO_Cntl_Msg::SET_LWM) this->msg_queue_->low_water_mark (wm_size); else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */ this->msg_queue_->high_water_mark (wm_size); } template ACE_INLINE int ACE_Task::getq (ACE_Message_Block *&mb, ACE_Time_Value *tv) { ACE_TRACE ("ACE_Task::getq"); return this->msg_queue_->dequeue_head (mb, tv); } template ACE_INLINE int ACE_Task::can_put (ACE_Message_Block *) { ACE_TRACE ("ACE_Task::can_put"); assert (!"not implemented"); return -1; } template ACE_INLINE int ACE_Task::putq (ACE_Message_Block *mb, ACE_Time_Value *tv) { ACE_TRACE ("ACE_Task::putq"); return this->msg_queue_->enqueue_tail (mb, tv); } template ACE_INLINE int ACE_Task::ungetq (ACE_Message_Block *mb, ACE_Time_Value *tv) { ACE_TRACE ("ACE_Task::ungetq"); return this->msg_queue_->enqueue_head (mb, tv); } template ACE_INLINE int ACE_Task::flush (u_long flag) { ACE_TRACE ("ACE_Task::flush"); if (ACE_BIT_ENABLED (flag, ACE_Task_Flags::ACE_FLUSHALL)) return this->msg_queue_ != 0 && this->msg_queue_->close (); else return -1; // Note, need to be more careful about what we free... } template ACE_INLINE void ACE_Task::msg_queue (ACE_Message_Queue *mq) { ACE_TRACE ("ACE_Task::msg_queue"); if (this->delete_msg_queue_) { delete this->msg_queue_; this->delete_msg_queue_ = 0; } this->msg_queue_ = mq; } template ACE_Message_Queue * ACE_Task::msg_queue (void) { ACE_TRACE ("ACE_Task::msg_queue"); return this->msg_queue_; } template ACE_INLINE int ACE_Task::reply (ACE_Message_Block *mb, ACE_Time_Value *tv) { ACE_TRACE ("ACE_Task::reply"); return this->sibling ()->put_next (mb, tv); } template ACE_INLINE ACE_Task * ACE_Task::next (void) { ACE_TRACE ("ACE_Task::next"); return this->next_; } template ACE_INLINE void ACE_Task::next (ACE_Task *q) { ACE_TRACE ("ACE_Task::next"); this->next_ = q; } // Transfer msg to the next ACE_Task. template ACE_INLINE int ACE_Task::put_next (ACE_Message_Block *msg, ACE_Time_Value *tv) { ACE_TRACE ("ACE_Task::put_next"); return this->next_ == 0 ? -1 : this->next_->put (msg, tv); }