Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Task_T.i

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: Task_T.i,v 1.1.1.2 2001/12/04 14:33:10 chad Exp $
00003 
00004 // Task_T.i
00005 
00006 template <ACE_SYNCH_DECL> ACE_INLINE void
00007 ACE_Task<ACE_SYNCH_USE>::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, 
00008                                     size_t wm_size)
00009 {
00010   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::water_marks");
00011   if (cmd == ACE_IO_Cntl_Msg::SET_LWM)
00012     this->msg_queue_->low_water_mark (wm_size);
00013   else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */
00014     this->msg_queue_->high_water_mark (wm_size);
00015 }
00016 
00017 template <ACE_SYNCH_DECL> ACE_INLINE int 
00018 ACE_Task<ACE_SYNCH_USE>::getq (ACE_Message_Block *&mb, ACE_Time_Value *tv)
00019 {
00020   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::getq");
00021   return this->msg_queue_->dequeue_head (mb, tv);
00022 }
00023 
00024 template <ACE_SYNCH_DECL> ACE_INLINE int 
00025 ACE_Task<ACE_SYNCH_USE>::can_put (ACE_Message_Block *)
00026 {
00027   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::can_put");
00028   assert (!"not implemented");
00029   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_ = 0;
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 }

Generated on Mon Jun 16 11:21:44 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002