1 #ifndef ACE_VECTOR_T_CPP
2 #define ACE_VECTOR_T_CPP
4 #if !defined (ACE_LACKS_PRAGMA_ONCE)
6 #endif /* ACE_LACKS_PRAGMA_ONCE */
8 #include "ace/Vector_T.h"
10 #if !defined (__ACE_INLINE__)
11 #include "ace/Vector_T.inl"
12 #endif /* __ACE_INLINE__ */
14 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
16 ACE_ALLOC_HOOK_DEFINE_Tcs(ACE_Vector
)
18 template <class T
, size_t DEFAULT_SIZE
>
19 void ACE_Vector
<T
, DEFAULT_SIZE
>::resize (const size_t new_size
,
22 ACE_Array
<T
>::size (new_size
);
23 if (new_size
> length_
)
24 for (size_t i
= length_
; i
< new_size
; ++i
)
27 curr_max_size_
= this->max_size ();
31 template <class T
, size_t DEFAULT_SIZE
>
32 void ACE_Vector
<T
, DEFAULT_SIZE
>::push_back (const T
& elem
)
34 if (length_
== curr_max_size_
)
36 ACE_Array
<T
>::size (curr_max_size_
* 2);
37 curr_max_size_
= this->max_size ();
40 ACE_Array
<T
>::size (length_
+ 1);
43 (*this)[length_
-1] = elem
;
46 template <class T
, size_t DEFAULT_SIZE
>
47 void ACE_Vector
<T
, DEFAULT_SIZE
>::dump (void) const
51 // Compare this vector with <s> for equality.
52 template <class T
, size_t DEFAULT_SIZE
> bool
53 ACE_Vector
<T
, DEFAULT_SIZE
>::operator== (const ACE_Vector
<T
, DEFAULT_SIZE
> &s
) const
57 else if (this->size () != s
.size ())
60 const size_t len
= s
.size ();
61 for (size_t slot
= 0; slot
< len
; ++slot
)
62 if ((*this)[slot
] != s
[slot
])
68 // ****************************************************************
69 ACE_ALLOC_HOOK_DEFINE_Tcs(ACE_Vector_Iterator
)
71 template <class T
, size_t DEFAULT_SIZE
> int
72 ACE_Vector_Iterator
<T
, DEFAULT_SIZE
>::next (T
*&item
)
74 // ACE_TRACE ("ACE_Vector_Iterator<T>::next");
83 item
= &vector_
[current_
];
88 ACE_END_VERSIONED_NAMESPACE_DECL
90 #endif /* ACE_VECTOR_T_CPP */