summaryrefslogtreecommitdiff
path: root/ACE/ace/Vector_T.inl
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 14:51:23 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 14:51:23 +0000
commit99aa8c60282c7b8072eb35eb9ac815702f5bf586 (patch)
treebda96bf8c3a4c2875a083d7b16720533c8ffeaf4 /ACE/ace/Vector_T.inl
parentc4078c377d74290ebe4e66da0b4975da91732376 (diff)
downloadATCD-99aa8c60282c7b8072eb35eb9ac815702f5bf586.tar.gz
undoing accidental deletion
Diffstat (limited to 'ACE/ace/Vector_T.inl')
-rw-r--r--ACE/ace/Vector_T.inl107
1 files changed, 107 insertions, 0 deletions
diff --git a/ACE/ace/Vector_T.inl b/ACE/ace/Vector_T.inl
new file mode 100644
index 00000000000..8dea22cd361
--- /dev/null
+++ b/ACE/ace/Vector_T.inl
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include <algorithm>
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE
+ACE_Vector<T, DEFAULT_SIZE>::ACE_Vector (const size_t init_size,
+ ACE_Allocator* alloc)
+ : ACE_Array<T> (init_size == 0 ? DEFAULT_SIZE : init_size, alloc),
+ length_ (0),
+ curr_max_size_ (this->max_size ())
+{
+}
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE
+ACE_Vector<T, DEFAULT_SIZE>::~ACE_Vector ()
+{
+}
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE
+size_t ACE_Vector<T, DEFAULT_SIZE>::capacity (void) const
+{
+ return curr_max_size_;
+}
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE
+size_t ACE_Vector<T, DEFAULT_SIZE>::size (void) const
+{
+ return length_;
+}
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE
+void ACE_Vector<T, DEFAULT_SIZE>::clear (void)
+{
+ length_ = 0;
+}
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE
+void ACE_Vector<T, DEFAULT_SIZE>::pop_back (void)
+{
+ if (length_ > 0)
+ {
+ --length_;
+ ACE_Array<T>::size (length_);
+ }
+}
+
+// Compare this vector with <s> for inequality.
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE bool
+ACE_Vector<T, DEFAULT_SIZE>::operator!= (const ACE_Vector<T, DEFAULT_SIZE> &s) const
+{
+ return !(*this == s);
+}
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE void
+ACE_Vector<T, DEFAULT_SIZE>::swap (ACE_Vector &rhs)
+{
+ ACE_Array<T>::swap (rhs);
+ std::swap (this->length_, rhs.length_);
+ std::swap (this->curr_max_size_, rhs.curr_max_size_);
+}
+
+// ****************************************************************
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE void
+ACE_Vector_Iterator<T, DEFAULT_SIZE>::dump (void) const
+{
+ // ACE_TRACE ("ACE_Vector_Iterator<T>::dump");
+}
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE
+ACE_Vector_Iterator<T, DEFAULT_SIZE>::ACE_Vector_Iterator (ACE_Vector<T, DEFAULT_SIZE> &v)
+ : current_ (0),
+ vector_ (v)
+{
+ // ACE_TRACE ("ACE_Vector_Iterator<T>::ACE_Vector_Iterator");
+}
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE int
+ACE_Vector_Iterator<T, DEFAULT_SIZE>::advance (void)
+{
+ // ACE_TRACE ("ACE_Vector_Iterator<T>::advance");
+
+ if (this->current_ < vector_.size ())
+ {
+ ++this->current_;
+ return 1;
+ }
+ else
+ // Already finished iterating.
+ return 0;
+}
+
+template <class T, size_t DEFAULT_SIZE> ACE_INLINE int
+ACE_Vector_Iterator<T, DEFAULT_SIZE>::done (void) const
+{
+ ACE_TRACE ("ACE_Vector_Iterator<T>::done");
+
+ return this->current_ >= vector_.size ();
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+