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 #ifndef SACADO_MPL_VECTOR_HPP
00033 #define SACADO_MPL_VECTOR_HPP
00034
00035 #include "Sacado_mpl_none.hpp"
00036 #include "Sacado_mpl_size.hpp"
00037 #include "Sacado_mpl_begin.hpp"
00038 #include "Sacado_mpl_end.hpp"
00039 #include "Sacado_mpl_next.hpp"
00040 #include "Sacado_mpl_push_back.hpp"
00041 #include "Sacado_mpl_at.hpp"
00042 #include "Sacado_mpl_deref.hpp"
00043
00044
00045 #include "Sacado_mpl_vector_size_spec.hpp"
00046 #include "Sacado_mpl_vector_at_spec.hpp"
00047
00048 namespace Sacado {
00049
00050 namespace mpl {
00051
00052
00053 struct vector_tag {};
00054
00055
00056 template <class T0 = mpl::none,
00057 class T1 = mpl::none,
00058 class T2 = mpl::none,
00059 class T3 = mpl::none,
00060 class T4 = mpl::none,
00061 class T5 = mpl::none,
00062 class T6 = mpl::none,
00063 class T7 = mpl::none,
00064 class T8 = mpl::none,
00065 class T9 = mpl::none>
00066 struct vector : vector_size<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
00067 typedef vector_tag tag;
00068 typedef vector type;
00069 typedef T0 t0;
00070 typedef T1 t1;
00071 typedef T2 t2;
00072 typedef T3 t3;
00073 typedef T4 t4;
00074 typedef T5 t5;
00075 typedef T6 t6;
00076 typedef T7 t7;
00077 typedef T8 t8;
00078 typedef T9 t9;
00079 };
00080
00081
00082 template <class Vector, int Pos>
00083 struct vector_iterator {
00084 static const int value = Pos;
00085 };
00086
00087
00088 template <>
00089 struct size_impl<vector_tag> {
00090 template <class Vector>
00091 struct apply {
00092 static const int value = Vector::sz;
00093 };
00094 };
00095
00096
00097 template <>
00098 struct begin_impl<vector_tag> {
00099 template <class Vector>
00100 struct apply {
00101 typedef vector_iterator<Vector,0> type;
00102 };
00103 };
00104
00105
00106 template <>
00107 struct end_impl<vector_tag> {
00108 template <class Vector>
00109 struct apply {
00110 typedef vector_iterator<Vector,Vector::sz> type;
00111 };
00112 };
00113
00114
00115 template <class Vector, int Pos>
00116 struct next< vector_iterator<Vector,Pos> > {
00117 typedef vector_iterator<Vector,Pos+1> type;
00118 };
00119
00120
00121
00122
00123 template <int Pos>
00124 struct at_impl<vector_tag, Pos> {
00125 template <class Vector>
00126 struct apply : vector_at<Vector,Pos> {};
00127 };
00128
00129
00130 template <class Vector, int Pos>
00131 struct deref< vector_iterator<Vector,Pos> > : mpl::at<Vector,Pos> {};
00132
00133 }
00134
00135 }
00136
00137 #include "Sacado_mpl_vector_push_back_spec.hpp"
00138
00139 namespace Sacado {
00140 namespace mpl {
00141
00142
00143 template <>
00144 struct push_back_impl<vector_tag> {
00145 template <class Vector, class T>
00146 struct apply : vector_push_back<Vector, T, mpl::size<Vector>::value> {};
00147 };
00148
00149 }
00150 }
00151
00152 #endif