/* -*- 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_; } // -- template ACE_INLINE int ACE_Ordered_MultiSet_Iterator::first (void) { ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::first"); current_ = set_.head_; return (current_ ? 1 : 0); } template ACE_INLINE int ACE_Ordered_MultiSet_Iterator::last (void) { ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::last"); current_ = set_.tail_; return (current_ ? 1 : 0); } template ACE_INLINE int ACE_Ordered_MultiSet_Iterator::advance (void) { ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::advance"); current_ = current_ ? current_->next_ : 0; return (current_ ? 1 : 0); } template ACE_INLINE int ACE_Ordered_MultiSet_Iterator::retreat (void) { ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::retreat"); current_ = current_ ? current_->prev_ : 0; return (current_ ? 1 : 0); } template ACE_INLINE int ACE_Ordered_MultiSet_Iterator::done (void) const { ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::done"); return (current_ ? 0 : 1); } template ACE_INLINE void ACE_Ordered_MultiSet_Iterator::dump (void) const { // ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::dump"); } // -- template ACE_INLINE int ACE_Ordered_MultiSet::is_empty (void) const { ACE_TRACE ("ACE_Ordered_MultiSet::is_empty"); return this->cur_size_ > 0 ? 0 : 1; } template ACE_INLINE size_t ACE_Ordered_MultiSet::size (void) const { // ACE_TRACE ("ACE_Ordered_MultiSet::size"); return this->cur_size_; }