Fixed typos
[ACE_TAO.git] / ACE / ace / Task_T.inl
blob99de01addef5df30e5cbb3e826f27a1c8089368a
1 // -*- C++ -*-
2 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
4 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE void
5 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
6                                       size_t wm_size)
8   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::water_marks");
9   if (cmd == ACE_IO_Cntl_Msg::SET_LWM)
10     this->msg_queue_->low_water_mark (wm_size);
11   else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */
12     this->msg_queue_->high_water_mark (wm_size);
15 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
16 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::getq (ACE_Message_Block *&mb, ACE_Time_Value *tv)
18   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::getq");
19   return this->msg_queue_->dequeue_head (mb, tv);
22 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
23 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::putq (ACE_Message_Block *mb, ACE_Time_Value *tv)
25   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::putq");
26   return this->msg_queue_->enqueue_tail (mb, tv);
29 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
30 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::ungetq (ACE_Message_Block *mb, ACE_Time_Value *tv)
32   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::ungetq");
33   return this->msg_queue_->enqueue_head (mb, tv);
36 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
37 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::flush (u_long f)
39   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::flush");
40   if (ACE_BIT_ENABLED (f, ACE_Task_Flags::ACE_FLUSHALL))
41     return this->msg_queue_ != 0 && this->msg_queue_->close ();
42   else
43     return -1;   // Note, need to be more careful about what we free...
46 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE void
47 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::msg_queue (ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *mq)
49   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::msg_queue");
50   if (this->delete_msg_queue_)
51     {
52       delete this->msg_queue_;
53       this->delete_msg_queue_ = false;
54     }
55   this->msg_queue_ = mq;
58 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *
59 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::msg_queue (void)
61   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::msg_queue");
62   return this->msg_queue_;
65 template <ACE_SYNCH_DECL, class TIME_POLICY>
66 ACE_Time_Value_T<TIME_POLICY>
67 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::gettimeofday (void) const
69   if (this->msg_queue_ != 0)
70     return this->msg_queue_->gettimeofday ();
72   return ACE_Time_Value_T<TIME_POLICY> (ACE_Time_Value::zero);
75 template <ACE_SYNCH_DECL, class TIME_POLICY>
76 void
77 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::set_time_policy (TIME_POLICY const & rhs)
79   if (this->msg_queue_ != 0)
80     this->msg_queue_->set_time_policy (rhs);
83 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
84 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::reply (ACE_Message_Block *mb, ACE_Time_Value *tv)
86   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::reply");
87   return this->sibling ()->put_next (mb, tv);
90 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *
91 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::next (void)
93   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::next");
94   return this->next_;
97 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE void
98 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::next (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *q)
100   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::next");
101   this->next_ = q;
104 // Transfer msg to the next ACE_Task.
106 template <ACE_SYNCH_DECL, class TIME_POLICY> ACE_INLINE int
107 ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::put_next (ACE_Message_Block *msg, ACE_Time_Value *tv)
109   ACE_TRACE ("ACE_Task<ACE_SYNCH_USE, TIME_POLICY>::put_next");
110   return this->next_ == 0 ? -1 : this->next_->put (msg, tv);
113 ACE_END_VERSIONED_NAMESPACE_DECL