00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PVECTOR_H
00016 #define PVECTOR_H
00017
00018 #include <vector>
00019
00020 #include "dtoolbase.h"
00021 #include "pallocator.h"
00022 #include "register_type.h"
00023
00024 #ifndef USE_STL_ALLOCATOR
00025
00026
00027 #define pvector vector
00028
00029 #else
00030
00031
00032
00033
00034
00035
00036
00037
00038 template<class Type>
00039 class pvector : public vector<Type, pallocator_array<Type> > {
00040 public:
00041 typedef pallocator_array<Type> allocator;
00042 typedef vector<Type, allocator> base_class;
00043 typedef TYPENAME base_class::size_type size_type;
00044
00045 pvector(TypeHandle type_handle = pvector_type_handle) : base_class(allocator(type_handle)) { }
00046 pvector(const pvector<Type> ©) : base_class(copy) { }
00047 pvector(size_type n, TypeHandle type_handle = pvector_type_handle) : base_class(n, Type(), allocator(type_handle)) { }
00048 pvector(size_type n, const Type &value, TypeHandle type_handle = pvector_type_handle) : base_class(n, value, allocator(type_handle)) { }
00049 pvector(const Type *begin, const Type *end, TypeHandle type_handle = pvector_type_handle) : base_class(begin, end, allocator(type_handle)) { }
00050 };
00051
00052 #endif // USE_STL_ALLOCATOR
00053
00054 #if defined(HAVE_EIGEN) && defined(_WIN32) && !defined(CPPPARSER)
00055
00056 #include <Eigen/StdVector>
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 template<class Type>
00078 class epvector : public vector<Type, Eigen::aligned_allocator<Type> > {
00079 public:
00080 typedef Eigen::aligned_allocator<Type> allocator;
00081 typedef vector<Type, allocator> base_class;
00082 typedef TYPENAME base_class::size_type size_type;
00083
00084 epvector(TypeHandle type_handle = pvector_type_handle) : base_class(allocator()) { }
00085 epvector(const epvector<Type> ©) : base_class(copy) { }
00086 epvector(size_type n, TypeHandle type_handle = pvector_type_handle) : base_class(n, Type(), allocator()) { }
00087 epvector(size_type n, const Type &value, TypeHandle type_handle = pvector_type_handle) : base_class(n, value, allocator()) { }
00088 epvector(const Type *begin, const Type *end, TypeHandle type_handle = pvector_type_handle) : base_class(begin, end, allocator()) { }
00089 };
00090
00091 #else // HAVE_EIGEN
00092 #define epvector pvector
00093 #endif // HAVE_EIGEN
00094
00095 #endif
00096