Task_Ex_T.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Task_Ex_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, class ACE_MESSAGE_TYPE> ACE_INLINE void
00010 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
00011                                     size_t wm_size)
00012 {
00013   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::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, class ACE_MESSAGE_TYPE> ACE_INLINE int
00021 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::getq (ACE_MESSAGE_TYPE *&mb, ACE_Time_Value *tv)
00022 {
00023   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::getq");
00024   return this->msg_queue_->dequeue_head (mb, tv);
00025 }
00026 
00027 template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
00028 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::can_put (ACE_MESSAGE_TYPE *)
00029 {
00030   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::can_put");
00031   assert (!"not implemented");
00032   return -1;
00033 }
00034 
00035 template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
00036 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::putq (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv)
00037 {
00038   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::putq");
00039   return this->msg_queue_->enqueue_tail (mb, tv);
00040 }
00041 
00042 template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
00043 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::ungetq (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv)
00044 {
00045   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::ungetq");
00046   return this->msg_queue_->enqueue_head (mb, tv);
00047 }
00048 
00049 template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
00050 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::flush (u_long flag)
00051 {
00052   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::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, class ACE_MESSAGE_TYPE> ACE_INLINE void
00060 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::msg_queue (ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE> *mq)
00061 {
00062   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::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, class ACE_MESSAGE_TYPE> ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE> *
00072 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::msg_queue (void)
00073 {
00074   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::msg_queue");
00075   return this->msg_queue_;
00076 }
00077 
00078 template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
00079 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::reply (ACE_MESSAGE_TYPE *mb, ACE_Time_Value *tv)
00080 {
00081   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::reply");
00082   ACE_UNUSED_ARG (mb);
00083   ACE_UNUSED_ARG (tv);
00084   return -1 ; // this->sibling ()->put_next (mb, tv);
00085 }
00086 
00087 template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE ACE_Task<ACE_SYNCH_USE> *
00088 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::next (void)
00089 {
00090   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::next");
00091   return this->next_;
00092 }
00093 
00094 template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE void
00095 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::next (ACE_Task<ACE_SYNCH_USE> *q)
00096 {
00097   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::next");
00098   this->next_ = q;
00099 }
00100 
00101 // Transfer msg to the next ACE_Task_Ex.
00102 
00103 template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int
00104 ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::put_next (
00105   ACE_MESSAGE_TYPE * /* msg */,
00106   ACE_Time_Value * /* tv */)
00107 {
00108   ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::put_next");
00109   return  -1; // this->next_ == 0 ? -1 : this->next_->put (msg, tv);
00110 }
00111 
00112 ACE_END_VERSIONED_NAMESPACE_DECL

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