00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef SELECT_CC
00012 #define SELECT_CC
00013
00015
00016 #include "selectimpl.h"
00017
00018 template<class T> inline
00019 void SelectList::pushBack(const InPort<T>& p, unsigned int n)
00020 {
00021 SelectImpl::pushBack(static_cast<InPortImpl>(p), n);
00022 }
00023
00024 template<class T> inline
00025 void SelectList::pushBack(const OutPort<T>& p, unsigned int n)
00026 {
00027 SelectImpl::pushBack(static_cast<OutPortImpl>(p), n);
00028 }
00029
00030 inline
00031 unsigned int SelectList::select () {
00032 return SelectImpl::select();
00033 }
00034
00035 inline unsigned int select (SelectList& l) {
00036 return l.select();
00037 }
00038
00039 template<class T0, class T1> inline
00040 unsigned int select( InPort<T0>& p0,
00041 InPort<T1>& p1)
00042 {
00043 SelectList s(id("internal"));
00044 s.pushBack (p0);
00045 s.pushBack (p1);
00046
00047 return s.select();
00048 }
00049
00050 template<class T0, class T1> inline
00051 unsigned int select( InPort<T0>& p0,
00052 OutPort<T1>& p1)
00053 {
00054 SelectList s(id("internal"));
00055 s.pushBack (p0);
00056 s.pushBack (p1);
00057
00058 return s.select();
00059 }
00060
00061 template<class T0, class T1> inline
00062 unsigned int select(OutPort<T0>& p0,
00063 OutPort<T1>& p1)
00064 {
00065 SelectList s(id("internal"));
00066 s.pushBack (p0);
00067 s.pushBack (p1);
00068
00069 return s.select();
00070 }
00071
00072 template<class T0, class T1, class T2> inline
00073 unsigned int select( InPort<T0>& p0,
00074 InPort<T1>& p1,
00075 InPort<T2>& p2)
00076 {
00077 SelectList s(id("internal"));
00078 s.pushBack (p0);
00079 s.pushBack (p1);
00080 s.pushBack (p2);
00081
00082 return s.select();
00083 }
00084
00085 template<class T0, class T1, class T2> inline
00086 unsigned int select( InPort<T0>& p0,
00087 InPort<T1>& p1,
00088 OutPort<T2>& p2)
00089 {
00090 SelectList s(id("internal"));
00091 s.pushBack (p0);
00092 s.pushBack (p1);
00093 s.pushBack (p2);
00094
00095 return s.select();
00096 }
00097
00098 template<class T0, class T1, class T2> inline
00099 unsigned int select( InPort<T0>& p0,
00100 OutPort<T1>& p1,
00101 OutPort<T2>& p2)
00102 {
00103 SelectList s(id("internal"));
00104 s.pushBack (p0);
00105 s.pushBack (p1);
00106 s.pushBack (p2);
00107
00108 return s.select();
00109 }
00110
00111 template<class T0, class T1, class T2> inline
00112 unsigned int select(OutPort<T0>& p0,
00113 OutPort<T1>& p1,
00114 OutPort<T2>& p2)
00115 {
00116 SelectList s(id("internal"));
00117 s.pushBack (p0);
00118 s.pushBack (p1);
00119 s.pushBack (p2);
00120
00121 return s.select();
00122 }
00123
00124 template<class T0, class T1, class T2, class T3> inline
00125 unsigned int select( InPort<T0>& p0,
00126 InPort<T1>& p1,
00127 InPort<T2>& p2,
00128 InPort<T3>& p3)
00129 {
00130 SelectList s(id("internal"));
00131 s.pushBack (p0);
00132 s.pushBack (p1);
00133 s.pushBack (p2);
00134 s.pushBack (p3);
00135
00136 return s.select();
00137 }
00138
00139 template<class T0, class T1, class T2, class T3> inline
00140 unsigned int select( InPort<T0>& p0,
00141 InPort<T1>& p1,
00142 InPort<T2>& p2,
00143 OutPort<T3>& p3)
00144 {
00145 SelectList s(id("internal"));
00146 s.pushBack (p0);
00147 s.pushBack (p1);
00148 s.pushBack (p2);
00149 s.pushBack (p3);
00150
00151 return s.select();
00152 }
00153
00154 template<class T0, class T1, class T2, class T3> inline
00155 unsigned int select( InPort<T0>& p0,
00156 InPort<T1>& p1,
00157 OutPort<T2>& p2,
00158 OutPort<T3>& p3)
00159 {
00160 SelectList s(id("internal"));
00161 s.pushBack (p0);
00162 s.pushBack (p1);
00163 s.pushBack (p2);
00164 s.pushBack (p3);
00165
00166 return s.select();
00167 }
00168
00169 template<class T0, class T1, class T2, class T3> inline
00170 unsigned int select( InPort<T0>& p0,
00171 OutPort<T1>& p1,
00172 OutPort<T2>& p2,
00173 OutPort<T3>& p3)
00174 {
00175 SelectList s(id("internal"));
00176 s.pushBack (p0);
00177 s.pushBack (p1);
00178 s.pushBack (p2);
00179 s.pushBack (p3);
00180
00181 return s.select();
00182 }
00183
00184 template<class T0, class T1, class T2, class T3> inline
00185 unsigned int select(OutPort<T0>& p0,
00186 OutPort<T1>& p1,
00187 OutPort<T2>& p2,
00188 OutPort<T3>& p3)
00189 {
00190 SelectList s(id("internal"));
00191 s.pushBack (p0);
00192 s.pushBack (p1);
00193 s.pushBack (p2);
00194 s.pushBack (p3);
00195
00196 return s.select();
00197 }
00198
00200
00201 template<class T0, class T1> inline
00202 unsigned int select( InPort<T0>& p0, unsigned int n0,
00203 InPort<T1>& p1, unsigned int n1)
00204 {
00205 SelectList s(id("internal"));
00206 s.pushBack (p0, n0);
00207 s.pushBack (p1, n1);
00208
00209 return s.select();
00210 }
00211
00212 template<class T0, class T1> inline
00213 unsigned int select( InPort<T0>& p0, unsigned int n0,
00214 OutPort<T1>& p1, unsigned int n1)
00215 {
00216 SelectList s(id("internal"));
00217 s.pushBack (p0, n0);
00218 s.pushBack (p1, n1);
00219
00220 return s.select();
00221 }
00222
00223 template<class T0, class T1> inline
00224 unsigned int select(OutPort<T0>& p0, unsigned int n0,
00225 OutPort<T1>& p1, unsigned int n1)
00226 {
00227 SelectList s(id("internal"));
00228 s.pushBack (p0, n0);
00229 s.pushBack (p1, n1);
00230
00231 return s.select();
00232 }
00233
00234 template<class T0, class T1, class T2> inline
00235 unsigned int select( InPort<T0>& p0, unsigned int n0,
00236 InPort<T1>& p1, unsigned int n1,
00237 InPort<T2>& p2, unsigned int n2)
00238 {
00239 SelectList s(id("internal"));
00240 s.pushBack (p0, n0);
00241 s.pushBack (p1, n1);
00242 s.pushBack (p2, n2);
00243
00244 return s.select();
00245 }
00246
00247 template<class T0, class T1, class T2> inline
00248 unsigned int select( InPort<T0>& p0, unsigned int n0,
00249 InPort<T1>& p1, unsigned int n1,
00250 OutPort<T2>& p2, unsigned int n2)
00251 {
00252 SelectList s(id("internal"));
00253 s.pushBack (p0, n0);
00254 s.pushBack (p1, n1);
00255 s.pushBack (p2, n2);
00256
00257 return s.select();
00258 }
00259
00260 template<class T0, class T1, class T2> inline
00261 unsigned int select( InPort<T0>& p0, unsigned int n0,
00262 OutPort<T1>& p1, unsigned int n1,
00263 OutPort<T2>& p2, unsigned int n2)
00264 {
00265 SelectList s(id("internal"));
00266 s.pushBack (p0, n0);
00267 s.pushBack (p1, n1);
00268 s.pushBack (p2, n2);
00269
00270 return s.select();
00271 }
00272
00273 template<class T0, class T1, class T2> inline
00274 unsigned int select(OutPort<T0>& p0, unsigned int n0,
00275 OutPort<T1>& p1, unsigned int n1,
00276 OutPort<T2>& p2, unsigned int n2)
00277 {
00278 SelectList s(id("internal"));
00279 s.pushBack (p0, n0);
00280 s.pushBack (p1, n1);
00281 s.pushBack (p2, n2);
00282
00283 return s.select();
00284 }
00285
00286 template<class T0, class T1, class T2, class T3> inline
00287 unsigned int select( InPort<T0>& p0, unsigned int n0,
00288 InPort<T1>& p1, unsigned int n1,
00289 InPort<T2>& p2, unsigned int n2,
00290 InPort<T3>& p3, unsigned int n3)
00291 {
00292 SelectList s(id("internal"));
00293 s.pushBack (p0, n0);
00294 s.pushBack (p1, n1);
00295 s.pushBack (p2, n2);
00296 s.pushBack (p3, n3);
00297
00298 return s.select();
00299 }
00300
00301 template<class T0, class T1, class T2, class T3> inline
00302 unsigned int select( InPort<T0>& p0, unsigned int n0,
00303 InPort<T1>& p1, unsigned int n1,
00304 InPort<T2>& p2, unsigned int n2,
00305 OutPort<T3>& p3, unsigned int n3)
00306 {
00307 SelectList s(id("internal"));
00308 s.pushBack (p0, n0);
00309 s.pushBack (p1, n1);
00310 s.pushBack (p2, n2);
00311 s.pushBack (p3, n3);
00312
00313 return s.select();
00314 }
00315
00316 template<class T0, class T1, class T2, class T3> inline
00317 unsigned int select( InPort<T0>& p0, unsigned int n0,
00318 InPort<T1>& p1, unsigned int n1,
00319 OutPort<T2>& p2, unsigned int n2,
00320 OutPort<T3>& p3, unsigned int n3)
00321 {
00322 SelectList s(id("internal"));
00323 s.pushBack (p0, n0);
00324 s.pushBack (p1, n1);
00325 s.pushBack (p2, n2);
00326 s.pushBack (p3, n3);
00327
00328 return s.select();
00329 }
00330
00331 template<class T0, class T1, class T2, class T3> inline
00332 unsigned int select( InPort<T0>& p0, unsigned int n0,
00333 OutPort<T1>& p1, unsigned int n1,
00334 OutPort<T2>& p2, unsigned int n2,
00335 OutPort<T3>& p3, unsigned int n3)
00336 {
00337 SelectList s(id("internal"));
00338 s.pushBack (p0, n0);
00339 s.pushBack (p1, n1);
00340 s.pushBack (p2, n2);
00341 s.pushBack (p3, n3);
00342
00343 return s.select();
00344 }
00345
00346 template<class T0, class T1, class T2, class T3> inline
00347 unsigned int select(OutPort<T0>& p0, unsigned int n0,
00348 OutPort<T1>& p1, unsigned int n1,
00349 OutPort<T2>& p2, unsigned int n2,
00350 OutPort<T3>& p3, unsigned int n3)
00351 {
00352 SelectList s(id("internal"));
00353 s.pushBack (p0, n0);
00354 s.pushBack (p1, n1);
00355 s.pushBack (p2, n2);
00356 s.pushBack (p3, n3);
00357
00358 return s.select();
00359 }
00360
00361 #endif