/* -*- C++ -*- */ // $Id$ template ACE_INLINE int ACE_Message_Queue::dequeue (ACE_Message_Block *&first_item, ACE_Time_Value *timeout) { ACE_TRACE ("ACE_Message_Queue::dequeue"); return this->dequeue_head (first_item, timeout); } template ACE_INLINE ACE_Notification_Strategy * ACE_Message_Queue::notification_strategy (void) { ACE_TRACE ("ACE_Message_Queue::notification_strategy"); return this->notification_strategy_; } template ACE_INLINE void ACE_Message_Queue::notification_strategy (ACE_Notification_Strategy *s) { ACE_TRACE ("ACE_Message_Queue::notification_strategy"); this->notification_strategy_ = s; } // Check if queue is empty (does not hold locks). template ACE_INLINE int ACE_Message_Queue::is_empty_i (void) { ACE_TRACE ("ACE_Message_Queue::is_empty_i"); return this->tail_ == 0; } // Check if queue is full (does not hold locks). template ACE_INLINE int ACE_Message_Queue::is_full_i (void) { ACE_TRACE ("ACE_Message_Queue::is_full_i"); return this->cur_bytes_ >= this->high_water_mark_; } // Check if queue is empty (holds locks). template ACE_INLINE int ACE_Message_Queue::is_empty (void) { ACE_TRACE ("ACE_Message_Queue::is_empty"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->is_empty_i (); } // Check if queue is full (holds locks). template ACE_INLINE int ACE_Message_Queue::is_full (void) { ACE_TRACE ("ACE_Message_Queue::is_full"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->is_full_i (); } template ACE_INLINE size_t ACE_Message_Queue::high_water_mark (void) { ACE_TRACE ("ACE_Message_Queue::high_water_mark"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0); return this->high_water_mark_; } template ACE_INLINE void ACE_Message_Queue::high_water_mark (size_t hwm) { ACE_TRACE ("ACE_Message_Queue::high_water_mark"); ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_); this->high_water_mark_ = hwm; } template ACE_INLINE size_t ACE_Message_Queue::low_water_mark (void) { ACE_TRACE ("ACE_Message_Queue::low_water_mark"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0); return this->low_water_mark_; } template ACE_INLINE void ACE_Message_Queue::low_water_mark (size_t lwm) { ACE_TRACE ("ACE_Message_Queue::low_water_mark"); ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_); this->low_water_mark_ = lwm; } template ACE_INLINE size_t ACE_Message_Queue::message_bytes (void) { ACE_TRACE ("ACE_Message_Queue::message_bytes"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0); return this->cur_bytes_; } template ACE_INLINE size_t ACE_Message_Queue::message_length (void) { ACE_TRACE ("ACE_Message_Queue::message_length"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0); return this->cur_length_; } template ACE_INLINE int ACE_Message_Queue::message_count (void) { ACE_TRACE ("ACE_Message_Queue::message_count"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0); return this->cur_count_; } template ACE_INLINE int ACE_Message_Queue::deactivate () { ACE_TRACE ("ACE_Message_Queue::deactivate"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->deactivate_i (0); // Not a pulse } template ACE_INLINE int ACE_Message_Queue::activate (void) { ACE_TRACE ("ACE_Message_Queue::activate"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->activate_i (); } template ACE_INLINE int ACE_Message_Queue::pulse () { ACE_TRACE ("ACE_Message_Queue::pulse"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->deactivate_i (1); // Just a pulse } template ACE_INLINE int ACE_Message_Queue::deactivated (void) { ACE_TRACE ("ACE_Message_Queue::deactivated"); return this->state_ == ACE_Message_Queue_Base::DEACTIVATED; } template ACE_INLINE int ACE_Message_Queue::state (void) { ACE_TRACE ("ACE_Message_Queue::state"); return this->state_; } #if 0 // The Sun Forte 6 (CC 5.1) compiler is only happy if this is in the // header file (j.russell.noseworthy@objectsciences.com) template ACE_INLINE ACE_SYNCH_MUTEX_T & ACE_Message_Queue::lock (void) { return this->lock_; } #endif /* 0 */ ACE_ALLOC_HOOK_DEFINE(ACE_Message_Queue_Reverse_Iterator) template ACE_INLINE int ACE_Message_Queue_Ex::dequeue (ACE_MESSAGE_TYPE *&first_item, ACE_Time_Value *timeout) { ACE_TRACE ("ACE_Message_Queue_Ex::dequeue"); return this->dequeue_head (first_item, timeout); } template ACE_INLINE ACE_Notification_Strategy * ACE_Message_Queue_Ex::notification_strategy (void) { ACE_TRACE ("ACE_Message_Queue_Ex::notification_strategy"); return this->queue_.notification_strategy (); } template ACE_INLINE void ACE_Message_Queue_Ex::notification_strategy (ACE_Notification_Strategy *s) { ACE_TRACE ("ACE_Message_Queue_Ex::notification_strategy"); this->queue_.notification_strategy (s); } // Check if queue is empty (holds locks). template ACE_INLINE int ACE_Message_Queue_Ex::is_empty (void) { ACE_TRACE ("ACE_Message_Queue_Ex::is_empty"); return this->queue_.is_empty (); } // Check if queue is full (holds locks). template ACE_INLINE int ACE_Message_Queue_Ex::is_full (void) { ACE_TRACE ("ACE_Message_Queue_Ex::is_full"); return this->queue_.is_full (); } template ACE_INLINE size_t ACE_Message_Queue_Ex::high_water_mark (void) { ACE_TRACE ("ACE_Message_Queue_Ex::high_water_mark"); return this->queue_.high_water_mark (); } template ACE_INLINE void ACE_Message_Queue_Ex::high_water_mark (size_t hwm) { ACE_TRACE ("ACE_Message_Queue_Ex::high_water_mark"); this->queue_.high_water_mark (hwm); } template ACE_INLINE size_t ACE_Message_Queue_Ex::low_water_mark (void) { ACE_TRACE ("ACE_Message_Queue_Ex::low_water_mark"); return this->queue_.low_water_mark (); } template ACE_INLINE void ACE_Message_Queue_Ex::low_water_mark (size_t lwm) { ACE_TRACE ("ACE_Message_Queue_Ex::low_water_mark"); this->queue_.low_water_mark (lwm); } template ACE_INLINE size_t ACE_Message_Queue_Ex::message_bytes (void) { ACE_TRACE ("ACE_Message_Queue_Ex::message_bytes"); return this->queue_.message_bytes (); } template ACE_INLINE size_t ACE_Message_Queue_Ex::message_length (void) { ACE_TRACE ("ACE_Message_Queue_Ex::message_length"); return this->queue_.message_length (); } template ACE_INLINE int ACE_Message_Queue_Ex::message_count (void) { ACE_TRACE ("ACE_Message_Queue_Ex::message_count"); return this->queue_.message_count (); } template ACE_INLINE int ACE_Message_Queue_Ex::deactivate (void) { ACE_TRACE ("ACE_Message_Queue_Ex::deactivate"); return this->queue_.deactivate (); } template ACE_INLINE int ACE_Message_Queue_Ex::activate (void) { ACE_TRACE ("ACE_Message_Queue_Ex::activate"); return this->queue_.activate (); } template ACE_INLINE int ACE_Message_Queue_Ex::pulse (void) { ACE_TRACE ("ACE_Message_Queue_Ex::pulse"); return this->queue_.pulse (); } template ACE_INLINE int ACE_Message_Queue_Ex::deactivated (void) { ACE_TRACE ("ACE_Message_Queue_Ex::deactivated"); return this->queue_.deactivated (); } template ACE_INLINE int ACE_Message_Queue_Ex::state (void) { ACE_TRACE ("ACE_Message_Queue_Ex::state"); return this->queue_.state (); } #if 0 // The Sun Forte 6 (CC 5.1) compiler is only happy if this is in the // header file (j.russell.noseworthy@objectsciences.com) template ACE_INLINE ACE_SYNCH_MUTEX_T & ACE_Message_Queue_Ex::lock (void) { return this->queue_.lock (); } #endif /* 0 */