Go to the documentation of this file.00001 #ifndef guard_unbounded_value_sequence_hpp
00002 #define guard_unbounded_value_sequence_hpp
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "tao/Unbounded_Value_Allocation_Traits_T.h"
00015 #include "tao/Value_Traits_T.h"
00016 #include "tao/Generic_Sequence_T.h"
00017
00018 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00019
00020 namespace TAO
00021 {
00022
00023 template<class T>
00024 class unbounded_value_sequence
00025 {
00026 public:
00027 typedef T value_type;
00028 typedef T element_type;
00029 typedef T const const_value_type;
00030 typedef value_type & subscript_type;
00031 typedef value_type const & const_subscript_type;
00032 typedef ::CORBA::ULong size_type;
00033
00034 typedef details::unbounded_value_allocation_traits<value_type,true> allocation_traits;
00035 typedef details::value_traits<value_type,true> element_traits;
00036 typedef details::generic_sequence<value_type, allocation_traits, element_traits> implementation_type;
00037
00038 inline unbounded_value_sequence()
00039 : impl_()
00040 {}
00041 inline explicit unbounded_value_sequence(CORBA::ULong maximum)
00042 : impl_(maximum)
00043 {}
00044 inline unbounded_value_sequence(
00045 CORBA::ULong maximum,
00046 CORBA::ULong length,
00047 value_type * data,
00048 CORBA::Boolean release = false)
00049 : impl_(maximum, length, data, release)
00050 {}
00051
00052 inline CORBA::ULong maximum() const {
00053 return impl_.maximum();
00054 }
00055 inline CORBA::Boolean release() const {
00056 return impl_.release();
00057 }
00058 inline CORBA::ULong length() const {
00059 return impl_.length();
00060 }
00061 inline void length(CORBA::ULong length) {
00062 impl_.length(length);
00063 }
00064 inline value_type const & operator[](CORBA::ULong i) const {
00065 return impl_[i];
00066 }
00067 inline value_type & operator[](CORBA::ULong i) {
00068 return impl_[i];
00069 }
00070 inline void replace(
00071 CORBA::ULong maximum,
00072 CORBA::ULong length,
00073 value_type * data,
00074 CORBA::Boolean release = false) {
00075 impl_.replace(maximum, length, data, release);
00076 }
00077 inline value_type const * get_buffer() const {
00078 return impl_.get_buffer();
00079 }
00080 inline value_type * get_buffer(CORBA::Boolean orphan = false) {
00081 return impl_.get_buffer(orphan);
00082 }
00083 inline void swap(unbounded_value_sequence & rhs) throw() {
00084 impl_.swap(rhs.impl_);
00085 }
00086 static value_type * allocbuf(CORBA::ULong maximum) {
00087 return implementation_type::allocbuf(maximum);
00088 }
00089 static void freebuf(value_type * buffer) {
00090 implementation_type::freebuf(buffer);
00091 }
00092
00093 #if defined TAO_HAS_SEQUENCE_ITERATORS && TAO_HAS_SEQUENCE_ITERATORS == 1
00094
00095
00096
00097
00098
00099
00100
00101 typedef details::Generic_Sequence_Iterator<details::generic_sequence<value_type, allocation_traits, element_traits> > iterator;
00102 typedef details::Const_Generic_Sequence_Iterator<details::generic_sequence<value_type, allocation_traits, element_traits> > const_iterator;
00103 typedef details::Generic_Sequence_Reverse_Iterator<details::generic_sequence<value_type, allocation_traits, element_traits> > reverse_iterator;
00104 typedef details::Const_Generic_Sequence_Reverse_Iterator<details::generic_sequence<value_type, allocation_traits, element_traits> > const_reverse_iterator;
00105
00106
00107 iterator begin (void)
00108 {
00109 return impl_.begin ();
00110 }
00111
00112
00113 const_iterator begin (void) const
00114 {
00115 return impl_.begin ();
00116 }
00117
00118
00119 iterator end (void)
00120 {
00121 return impl_.end ();
00122 }
00123
00124
00125 const_iterator end (void) const
00126 {
00127 return impl_.end ();
00128 }
00129
00130
00131 reverse_iterator rbegin (void)
00132 {
00133 return impl_.rbegin ();
00134 }
00135
00136
00137 const_reverse_iterator rbegin (void) const
00138 {
00139 return impl_.rbegin ();
00140 }
00141
00142
00143
00144 reverse_iterator rend (void)
00145 {
00146 return impl_.rend ();
00147 }
00148
00149
00150
00151 const_reverse_iterator rend (void) const
00152 {
00153 return impl_.rend ();
00154 }
00155
00156 #endif
00157
00158 private:
00159 implementation_type impl_;
00160 };
00161
00162 }
00163
00164 TAO_END_VERSIONED_NAMESPACE_DECL
00165
00166 #endif // guard_unbounded_string_sequence_hpp
00167