/* -*- C++ -*- */ // $Id$ // Containers.i template ACE_INLINE int ACE_Bounded_Stack::is_empty (void) const { ACE_TRACE ("ACE_Bounded_Stack::is_empty"); return this->top_ == 0; } template ACE_INLINE int ACE_Bounded_Stack::is_full (void) const { ACE_TRACE ("ACE_Bounded_Stack::is_full"); return this->top_ >= this->size_; } template ACE_INLINE int ACE_Bounded_Stack::push (const T &new_item) { ACE_TRACE ("ACE_Bounded_Stack::push"); if (this->is_full () == 0) { this->stack_[this->top_++] = new_item; return 0; } else return -1; } template ACE_INLINE int ACE_Bounded_Stack::pop (T &item) { ACE_TRACE ("ACE_Bounded_Stack::pop"); if (this->is_empty () == 0) { item = this->stack_[--this->top_]; return 0; } else return -1; } template ACE_INLINE int ACE_Bounded_Stack::top (T &item) const { ACE_TRACE ("ACE_Bounded_Stack::top"); if (this->is_empty () == 0) { item = this->stack_[this->top_ - 1]; return 0; } else return -1; } template ACE_INLINE size_t ACE_Bounded_Stack::size (void) const { return this->size_; } //---------------------------------------- template ACE_INLINE int ACE_Fixed_Stack::is_empty (void) const { ACE_TRACE ("ACE_Fixed_Stack::is_empty"); return this->top_ == 0; } template ACE_INLINE int ACE_Fixed_Stack::is_full (void) const { ACE_TRACE ("ACE_Fixed_Stack::is_full"); return this->top_ >= this->size_; } template ACE_INLINE int ACE_Fixed_Stack::push (const T &new_item) { ACE_TRACE ("ACE_Fixed_Stack::push"); if (this->is_full () == 0) { this->stack_[this->top_++] = new_item; return 0; } else return -1; } template ACE_INLINE int ACE_Fixed_Stack::pop (T &item) { ACE_TRACE ("ACE_Fixed_Stack::pop"); if (this->is_empty () == 0) { item = this->stack_[--this->top_]; return 0; } else return -1; } template ACE_INLINE int ACE_Fixed_Stack::top (T &item) const { ACE_TRACE ("ACE_Fixed_Stack::top"); if (this->is_empty () == 0) { item = this->stack_[this->top_ - 1]; return 0; } else return -1; } template ACE_INLINE size_t ACE_Fixed_Stack::size (void) const { return this->size_; } //---------------------------------------- template ACE_INLINE int ACE_Unbounded_Stack::is_empty (void) const { ACE_TRACE ("ACE_Unbounded_Stack::is_empty"); return this->head_ == this->head_->next_; } template ACE_INLINE int ACE_Unbounded_Stack::top (T &item) const { ACE_TRACE ("ACE_Unbounded_Stack::top"); if (this->is_empty () == 0) { item = this->head_->next_->item_; return 0; } else return -1; } template ACE_INLINE int ACE_Unbounded_Stack::is_full (void) const { ACE_TRACE ("ACE_Unbounded_Stack::is_full"); return 0; // ??? } template ACE_INLINE size_t ACE_Unbounded_Stack::size (void) const { return this->cur_size_; } // --- template ACE_INLINE size_t ACE_Unbounded_Queue::size (void) const { return this->cur_size_; } template ACE_INLINE int ACE_Unbounded_Queue::is_empty (void) const { ACE_TRACE ("ACE_Unbounded_Queue::is_empty"); return this->head_ == this->head_->next_; } template ACE_INLINE int ACE_Unbounded_Queue::is_full (void) const { ACE_TRACE ("ACE_Unbounded_Queue::is_full"); return 0; // We should implement a "node of last resort for this..." } // --- template ACE_INLINE int ACE_Unbounded_Set::is_empty (void) const { ACE_TRACE ("ACE_Unbounded_Set::is_empty"); return this->head_ == this->head_->next_; } template ACE_INLINE int ACE_Unbounded_Set::is_full (void) const { ACE_TRACE ("ACE_Unbounded_Set::is_full"); return 0; // We should implement a "node of last resort for this..." } // --- template ACE_INLINE int ACE_Fixed_Set::is_empty (void) const { ACE_TRACE ("ACE_Fixed_Set::is_empty"); return this->cur_size_ == 0; } template ACE_INLINE int ACE_Fixed_Set::is_full (void) const { ACE_TRACE ("ACE_Fixed_Set::is_full"); return this->cur_size_ == this->max_size_; } // --- template ACE_INLINE int ACE_Bounded_Set::is_empty (void) const { ACE_TRACE ("ACE_Bounded_Set::is_empty"); return this->cur_size_ == 0; } template ACE_INLINE int ACE_Bounded_Set::is_full (void) const { ACE_TRACE ("ACE_Bounded_Set::is_full"); return this->cur_size_ == this->max_size_; }