Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Array_Base.inl

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: Array_Base.inl,v 1.1.1.1 2001/12/04 14:32:59 chad Exp $
00003 
00004 // Clean up the array (e.g., delete dynamically allocated memory).
00005 
00006 template <class T> ACE_INLINE
00007 ACE_Array_Base<T>::~ACE_Array_Base (void)
00008 {
00009   ACE_DES_ARRAY_FREE (this->array_,
00010                       this->max_size_,
00011                       this->allocator_->free,
00012                       T);
00013 }
00014 
00015 template <class T> ACE_INLINE size_t
00016 ACE_Array_Base<T>::size (void) const
00017 {
00018   return this->cur_size_;
00019 }
00020 
00021 template <class T> ACE_INLINE size_t
00022 ACE_Array_Base<T>::max_size (void) const
00023 {
00024   return this->max_size_;
00025 }
00026 
00027 template <class T> ACE_INLINE int
00028 ACE_Array_Base<T>::in_range (size_t index) const
00029 {
00030   return index < this->cur_size_;
00031 }
00032 
00033 template <class T> ACE_INLINE T &
00034 ACE_Array_Base<T>::operator[] (size_t index)
00035 {
00036   return this->array_[index];
00037 }
00038 
00039 template <class T> ACE_INLINE const T &
00040 ACE_Array_Base<T>::operator[] (size_t index) const
00041 {
00042   return this->array_[index];
00043 }
00044 
00045 // ****************************************************************
00046 
00047 template <class T> ACE_INLINE void
00048 ACE_Array_Iterator<T>::dump (void) const
00049 {
00050   // ACE_TRACE ("ACE_Array_Iterator<T>::dump");
00051 }
00052 
00053 template <class T> ACE_INLINE
00054 ACE_Array_Iterator<T>::ACE_Array_Iterator (ACE_Array_Base<T> &a)
00055     : current_ (0),
00056       array_ (a)
00057 {
00058   // ACE_TRACE ("ACE_Array_Iterator<T>::ACE_Array_Iterator");
00059 }
00060 
00061 template <class T> ACE_INLINE int
00062 ACE_Array_Iterator<T>::advance (void)
00063 {
00064   // ACE_TRACE ("ACE_Array_Iterator<T>::advance");
00065 
00066   if (this->current_ < array_.size ())
00067     {
00068       ++this->current_;
00069       return 1;
00070     }
00071   else
00072     {
00073       // Already finished iterating.
00074       return 0;
00075     }
00076 }
00077 
00078 template <class T> ACE_INLINE int
00079 ACE_Array_Iterator<T>::done (void) const
00080 {
00081   ACE_TRACE ("ACE_Array_Iterator<T>::done");
00082 
00083   return this->current_ >= array_.size ();
00084 }

Generated on Mon Jun 16 11:19:04 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002