diff options
author | jhoffert <jhoffert@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-11-13 13:45:26 +0000 |
---|---|---|
committer | jhoffert <jhoffert@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-11-13 13:45:26 +0000 |
commit | 6734c344dc6bbcfb5b18e11c03ab619d42c826ce (patch) | |
tree | a0fd57274345a8960f1e11d3830e195075532f88 | |
parent | 935070205e0e228746b734d05a9173bc115869c0 (diff) | |
download | ATCD-6734c344dc6bbcfb5b18e11c03ab619d42c826ce.tar.gz |
Changed iterator to take only one template parameter.
-rw-r--r-- | TAO/tao/Unbounded_Basic_String_Sequence_T.h | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/TAO/tao/Unbounded_Basic_String_Sequence_T.h b/TAO/tao/Unbounded_Basic_String_Sequence_T.h index e1ac398a9e2..69be8263156 100644 --- a/TAO/tao/Unbounded_Basic_String_Sequence_T.h +++ b/TAO/tao/Unbounded_Basic_String_Sequence_T.h @@ -119,10 +119,10 @@ public: /// // = Traits and factory methods that create iterators. - typedef details::Generic_Sequence_Iterator<value_type, allocation_traits, element_traits> iterator; - typedef details::Const_Generic_Sequence_Iterator<value_type, allocation_traits, element_traits> const_iterator; - typedef details::Generic_Sequence_Reverse_Iterator<value_type, allocation_traits, element_traits> reverse_iterator; - typedef details::Const_Generic_Sequence_Reverse_Iterator<value_type, allocation_traits, element_traits> const_reverse_iterator; + typedef details::Generic_Sequence_Iterator<details::generic_sequence<value_type, allocation_traits, element_traits> > iterator; + typedef details::Const_Generic_Sequence_Iterator<details::generic_sequence<value_type, allocation_traits, element_traits> > const_iterator; + typedef details::Generic_Sequence_Reverse_Iterator<details::generic_sequence<value_type, allocation_traits, element_traits> > reverse_iterator; + typedef details::Const_Generic_Sequence_Reverse_Iterator<details::generic_sequence<value_type, allocation_traits, element_traits> > const_reverse_iterator; // Get an iterator that points to the beginning of the sequence. iterator begin (void) @@ -177,6 +177,38 @@ public: private: implementation_type impl_; }; + +/* +// Generic_Sequence_Iterator template specializations for +// Unbounded_Basic_String_Sequence. These are needed since +// Unbounded_Basic_String_Sequence does some memory management with +// the strings. Without these specialization we leak memory. + +/// Dereference operator returns a reference to the item contained +/// at the current position. This dereference implies string +/// memory management. +// template<typename charT> + unbounded_basic_string_sequence<char>::element_type& + details::Generic_Sequence_Iterator<unbounded_basic_string_sequence<char> >::operator* (void) + { + // Access the underlying element in the sequence. + //return element_type (impl_[i], release()); + return element_type (this->sequence_[this->pos_], + this->sequence_.release()); + } + + /// Returns a const reference to the item contained at the current position + // template<typename charT> + unbounded_basic_string_sequence<char>::const_element_type& + details::Generic_Sequence_Iterator<unbounded_basic_string_sequence<char> >::operator* (void) const + { + // Access the underlying element in the sequence. + //return const_element_type (impl_[i], release()); + return const_element_type (this->sequence_[this->pos_], + this->sequence_.release ()); + } +*/ + } // namespace TAO TAO_END_VERSIONED_NAMESPACE_DECL |