00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00048 #ifndef STLSOFT_INCL_STLSOFT_COLLECTIONS_HPP_SEQUENCE_CONTAINER_VENEER
00049 #define STLSOFT_INCL_STLSOFT_COLLECTIONS_HPP_SEQUENCE_CONTAINER_VENEER
00050
00051 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00052 # define STLSOFT_VER_STLSOFT_COLLECTIONS_HPP_SEQUENCE_CONTAINER_VENEER_MAJOR 4
00053 # define STLSOFT_VER_STLSOFT_COLLECTIONS_HPP_SEQUENCE_CONTAINER_VENEER_MINOR 0
00054 # define STLSOFT_VER_STLSOFT_COLLECTIONS_HPP_SEQUENCE_CONTAINER_VENEER_REVISION 3
00055 # define STLSOFT_VER_STLSOFT_COLLECTIONS_HPP_SEQUENCE_CONTAINER_VENEER_EDIT 50
00056 #endif
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00074 # include <stlsoft/stlsoft.h>
00075 #endif
00076
00077 #if defined(STLSOFT_COMPILER_IS_MSVC) && \
00078 _MSC_VER < 1200
00079 # error stlsoft/collections/sequence_container_veneer.hpp is not compatible with Visual C++ 5.0 or earlier
00080 #endif
00081
00082 #ifndef STLSOFT_INCL_STLSOFT_COLLECTIONS_UTIL_HPP_COLLECTIONS
00083 # include <stlsoft/collections/util/collections.hpp>
00084 #endif
00085
00086 #ifdef STLSOFT_UNITTEST
00087 # include <algorithm>
00088 # include <list>
00089 # include <numeric>
00090 # include <vector>
00091 #endif
00092
00093
00094
00095
00096
00097 #ifndef _STLSOFT_NO_NAMESPACE
00098 namespace stlsoft
00099 {
00100 #endif
00101
00102
00103
00104
00105
00115 template< ss_typename_param_k T
00116 , ss_typename_param_k F
00117 >
00118 class sequence_container_veneer
00119 : public T
00120 , public stl_collection_tag
00121 {
00122 public:
00124 typedef T container_type;
00126 typedef F element_destruction_function_type;
00128 typedef sequence_container_veneer<T, F> class_type;
00129 private:
00130 typedef T parent_class_type;
00131 public:
00133 typedef ss_typename_type_k parent_class_type::allocator_type allocator_type;
00135 typedef ss_typename_type_k parent_class_type::size_type size_type;
00136
00137
00138 public:
00139 #ifdef STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
00141 sequence_container_veneer()
00142 {}
00143
00145 sequence_container_veneer(class_type const& rhs)
00146 : parent_class_type(rhs)
00147 {}
00148
00149 # if !defined(STLSOFT_COMPILER_IS_DMC)
00151 ss_explicit_k sequence_container_veneer(allocator_type const& a)
00152 : parent_class_type(a)
00153 {}
00155 template <ss_typename_param_k I>
00156 sequence_container_veneer(I i1, I i2)
00157 : parent_class_type(i1, i2)
00158 {}
00160 template <ss_typename_param_k I>
00161 sequence_container_veneer(I i1, I i2, allocator_type const& a)
00162 : parent_class_type(i1, i2, a)
00163 {}
00165 template <ss_typename_param_k V>
00166 sequence_container_veneer(size_type n, V v)
00167 : parent_class_type(n, v)
00168 {}
00170 template <ss_typename_param_k V>
00171 sequence_container_veneer(size_type n, V v, allocator_type const& a)
00172 : parent_class_type(n, v, a)
00173 {}
00174 # else
00175 template <ss_typename_param_k N1>
00176 ss_explicit_k sequence_container_veneer(N1 n1)
00177 : parent_class_type(n1)
00178 {}
00179 template< ss_typename_param_k N1
00180 , ss_typename_param_k N2
00181 >
00182 sequence_container_veneer(N1 n1, N2 n2)
00183 : parent_class_type(n1, n2)
00184 {}
00185 template< ss_typename_param_k N1
00186 , ss_typename_param_k N2
00187 , ss_typename_param_k N3
00188 >
00189 sequence_container_veneer(N1 n1, N2 n2, N3 n3)
00190 : parent_class_type(n1, n2, n3)
00191 {}
00192 template< ss_typename_param_k N1
00193 , ss_typename_param_k N2
00194 , ss_typename_param_k N3
00195 , ss_typename_param_k N4
00196 >
00197 sequence_container_veneer(N1 n1, N2 n2, N3 n3, N4 n4)
00198 : parent_class_type(n1, n2, n3, n4)
00199 {}
00200 template< ss_typename_param_k N1
00201 , ss_typename_param_k N2
00202 , ss_typename_param_k N3
00203 , ss_typename_param_k N4
00204 , ss_typename_param_k N5
00205 >
00206 sequence_container_veneer(N1 n1, N2 n2, N3 n3, N4 n4, N5 n5)
00207 : parent_class_type(n1, n2, n3, n4, n5)
00208 {}
00209 # endif
00210 #endif
00211
00214 ~sequence_container_veneer() stlsoft_throw_0()
00215 {
00216
00217
00218 parent_class_type *this_ = this;
00219
00220 ss_typename_type_k container_type::iterator b = this_->begin();
00221 ss_typename_type_k container_type::iterator e = this_->end();
00222
00223 for(; b != e; ++b)
00224 {
00225 element_destruction_function_type()(*b);
00226 }
00227 }
00228
00235 class_type& operator =(class_type const& rhs)
00236 {
00237 parent_class_type::operator =(rhs);
00238
00239 return *this;
00240 }
00241
00242 protected:
00245 void *operator new(ss_size_t )
00246 {
00247 return 0;
00248 }
00251 void operator delete(void*)
00252 {}
00253 };
00254
00256
00257
00258 #ifdef STLSOFT_UNITTEST
00259 # include "./unittest/sequence_container_veneer_unittest_.h"
00260 #endif
00261
00262
00263
00264 #ifndef _STLSOFT_NO_NAMESPACE
00265 }
00266 #endif
00267
00268
00269
00270 #endif
00271
00272