diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-05-05 22:34:06 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-05-05 22:34:06 +0000 |
commit | 01950efe74ac03f228c428b4726f7afcca5d36f0 (patch) | |
tree | a07cc5b1199793565c432d915b0ae2c1aa216ed8 /ace/Containers.i | |
parent | 3da02e5f0119cb5837e49b20ddf78d2b343a4712 (diff) | |
download | ATCD-01950efe74ac03f228c428b4726f7afcca5d36f0.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/Containers.i')
-rw-r--r-- | ace/Containers.i | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/ace/Containers.i b/ace/Containers.i new file mode 100644 index 00000000000..18218b3f41c --- /dev/null +++ b/ace/Containers.i @@ -0,0 +1,105 @@ +/* -*- C++ -*- */ +// $Id$ + +// Containers.i + +template <class T> ACE_INLINE void +ACE_Bounded_Stack<T>::push (const T &new_item) +{ + ACE_TRACE ("ACE_Bounded_Stack<T>::push"); + this->stack_[this->top_++] = new_item; +} + +template <class T> ACE_INLINE void +ACE_Bounded_Stack<T>::pop (T &item) +{ + ACE_TRACE ("ACE_Bounded_Stack<T>::pop"); + item = this->stack_[--this->top_]; +} + +template <class T> ACE_INLINE void +ACE_Bounded_Stack<T>::top (T &item) const +{ + ACE_TRACE ("ACE_Bounded_Stack<T>::top"); + item = this->stack_[this->top_ - 1]; +} + +template <class T> ACE_INLINE int +ACE_Bounded_Stack<T>::is_empty (void) const +{ + ACE_TRACE ("ACE_Bounded_Stack<T>::is_empty"); + return this->top_ == 0; +} + +template <class T> ACE_INLINE int +ACE_Bounded_Stack<T>::is_full (void) const +{ + ACE_TRACE ("ACE_Bounded_Stack<T>::is_full"); + return this->top_ >= this->size_; +} + +//---------------------------------------- + +template <class T, size_t SIZE> ACE_INLINE void +ACE_Fixed_Stack<T, SIZE>::push (const T &new_item) +{ + ACE_TRACE ("ACE_Fixed_Stack<T, SIZE>::push"); + this->stack_[this->top_++] = new_item; +} + +template <class T, size_t SIZE> ACE_INLINE void +ACE_Fixed_Stack<T, SIZE>::pop (T &item) +{ + ACE_TRACE ("ACE_Fixed_Stack<T, SIZE>::pop"); + item = this->stack_[--this->top_]; +} + +template <class T, size_t SIZE> ACE_INLINE void +ACE_Fixed_Stack<T, SIZE>::top (T &item) const +{ + ACE_TRACE ("ACE_Fixed_Stack<T, SIZE>::top"); + item = this->stack_[this->top_ - 1]; +} + +template <class T, size_t SIZE> ACE_INLINE int +ACE_Fixed_Stack<T, SIZE>::is_empty (void) const +{ + ACE_TRACE ("ACE_Fixed_Stack<T, SIZE>::is_empty"); + return this->top_ == 0; +} + +template <class T, size_t SIZE> ACE_INLINE int +ACE_Fixed_Stack<T, SIZE>::is_full (void) const +{ + ACE_TRACE ("ACE_Fixed_Stack<T, SIZE>::is_full"); + return this->top_ >= this->size_; +} + +//---------------------------------------- + +template <class T> ACE_INLINE void +ACE_Unbounded_Stack<T>::top (T &item) const +{ + ACE_TRACE ("ACE_Unbounded_Stack<T>::top"); + item = this->head_->item_; +} + +template <class T> ACE_INLINE int +ACE_Unbounded_Stack<T>::is_empty (void) const +{ + ACE_TRACE ("ACE_Unbounded_Stack<T>::is_empty"); + return this->head_ == 0; +} + +template <class T> ACE_INLINE int +ACE_Unbounded_Stack<T>::is_full (void) const +{ + ACE_TRACE ("ACE_Unbounded_Stack<T>::is_full"); + return this->last_resort_ == 0; +} + +template <class TYPE> ACE_INLINE size_t +ACE_Unbounded_Queue<TYPE>::size (void) const +{ + return this->cur_size_; +} |