00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00026
00038
00039
00040 #ifndef _CTTL_XTL_OP_H_INCLUDED_
00041 #define _CTTL_XTL_OP_H_INCLUDED_
00042
00043 #include "xtl_op_impl.h"
00044
00045 namespace cttl {
00046
00048
00050
00067 template< typename ExprT >
00068 inline
00069 xtl_wrap<
00070 xtl_opunarbang<
00071 xtl_wrap< ExprT >
00072 >
00073 >
00074 operator! ( xtl_wrap< ExprT > const& expr_ )
00075 {
00076 typedef
00077 xtl_opunarbang<
00078 xtl_wrap< ExprT >
00079 >
00080 opfind_T;
00081
00082 return xtl_wrap< opfind_T >( opfind_T( expr_ ) );
00083 }
00084
00085
00102 template< typename ExprT >
00103 inline
00104 xtl_wrap<
00105 xtl_opunarstar<
00106 xtl_wrap< ExprT >
00107 >
00108 >
00109 operator* ( xtl_wrap< ExprT > const& expr_ )
00110 {
00111 typedef
00112 xtl_opunarstar<
00113 xtl_wrap< ExprT >
00114 >
00115 opstar_T;
00116
00117 return xtl_wrap< opstar_T >( opstar_T( expr_ ) );
00118 }
00119
00139 template< typename Left_exprT >
00140 inline
00141 xtl_wrap<
00142 xtl_opunarstar<
00143 xtl_wrap< Left_exprT >
00144 >
00145 >
00146 operator* ( xtl_wrap< Left_exprT > const& lhs_expr_, int upper_limit_ )
00147 {
00148 typedef
00149 xtl_opunarstar<
00150 xtl_wrap< Left_exprT >
00151 >
00152 opstar_T;
00153
00154 return xtl_wrap< opstar_T >( opstar_T( lhs_expr_, upper_limit_ ) );
00155 }
00156
00173 template< typename ExprT >
00174 inline
00175 xtl_wrap<
00176 xtl_opunarplus<
00177 xtl_wrap< ExprT >
00178 >
00179 >
00180 operator+ ( xtl_wrap< ExprT > const& expr_ )
00181 {
00182 typedef
00183 xtl_opunarplus<
00184 xtl_wrap< ExprT >
00185 >
00186 opplus_T;
00187
00188 return xtl_wrap< opplus_T >( opplus_T( expr_ ) );
00189 }
00190
00210 template< typename Left_exprT >
00211 inline
00212 xtl_wrap<
00213 xtl_opunarplus<
00214 xtl_wrap< Left_exprT >
00215 >
00216 >
00217 operator+ ( xtl_wrap< Left_exprT > const& lhs_expr_, int upper_limit_ )
00218 {
00219 typedef
00220 xtl_opunarplus<
00221 xtl_wrap< Left_exprT >
00222 >
00223 opplus_T;
00224
00225 return xtl_wrap< opplus_T >( opplus_T( lhs_expr_, upper_limit_ ) );
00226 }
00227
00228
00251 template< typename Left_exprT >
00252 inline
00253 xtl_wrap<
00254 xtl_opunarplus<
00255 xtl_wrap< Left_exprT >
00256 >
00257 >
00258 operator+ ( xtl_wrap< Left_exprT > const& lhs_expr_, std::pair< int, int > limits_ )
00259 {
00260 typedef
00261 xtl_opunarplus<
00262 xtl_wrap< Left_exprT >
00263 >
00264 opplus_T;
00265
00266 return xtl_wrap< opplus_T >( opplus_T( lhs_expr_, limits_.second, limits_.first ) );
00267 }
00268
00285 template< typename ExprT >
00286 inline
00287 xtl_wrap<
00288 xtl_opunarminus<
00289 xtl_wrap< ExprT >
00290 >
00291 >
00292 operator- ( xtl_wrap< ExprT > const& expr_ )
00293 {
00294 typedef
00295 xtl_opunarminus<
00296 xtl_wrap< ExprT >
00297 >
00298 opminus_T;
00299
00300 return xtl_wrap< opminus_T >( opminus_T( expr_ ) );
00301 }
00302
00304
00306
00331 template< typename Left_exprT, typename Right_exprT >
00332 inline
00333 xtl_wrap<
00334 xtl_opbinplus<
00335 xtl_wrap< Left_exprT >,
00336 xtl_wrap< Right_exprT >
00337 >
00338 >
00339 operator+ ( xtl_wrap< Left_exprT > const& lhs_expr_, xtl_wrap< Right_exprT > const& rhs_expr_ )
00340 {
00341 typedef
00342 xtl_opbinplus<
00343 xtl_wrap< Left_exprT >,
00344 xtl_wrap< Right_exprT >
00345 >
00346 opplus_T;
00347
00348 return xtl_wrap< opplus_T >( opplus_T( lhs_expr_, rhs_expr_ ) );
00349 }
00350
00375 template< typename Left_exprT, typename Right_exprT >
00376 inline
00377 xtl_wrap<
00378 xtl_opbinpipe<
00379 xtl_wrap< Left_exprT >,
00380 xtl_wrap< Right_exprT >
00381 >
00382 >
00383 operator| ( xtl_wrap< Left_exprT > const& lhs_expr_, xtl_wrap< Right_exprT > const& rhs_expr_ )
00384 {
00385 typedef
00386 xtl_opbinpipe<
00387 xtl_wrap< Left_exprT >,
00388 xtl_wrap< Right_exprT >
00389 >
00390 oppipe_T;
00391
00392 return xtl_wrap< oppipe_T >( oppipe_T( lhs_expr_, rhs_expr_ ) );
00393 }
00394
00419 template< typename Left_exprT, typename Right_exprT >
00420 inline
00421 xtl_wrap<
00422 xtl_opbin2pipe<
00423 xtl_wrap< Left_exprT >,
00424 xtl_wrap< Right_exprT >
00425 >
00426 >
00427 operator|| ( xtl_wrap< Left_exprT > const& lhs_expr_, xtl_wrap< Right_exprT > const& rhs_expr_ )
00428 {
00429 typedef
00430 xtl_opbin2pipe<
00431 xtl_wrap< Left_exprT >,
00432 xtl_wrap< Right_exprT >
00433 >
00434 oppipe_T;
00435
00436 return xtl_wrap< oppipe_T >( oppipe_T( lhs_expr_, rhs_expr_ ) );
00437 }
00438
00463 template< typename Left_exprT, typename Right_exprT >
00464 inline
00465 xtl_wrap<
00466 xtl_opbinconcat<
00467 xtl_wrap< Left_exprT >,
00468 xtl_wrap< Right_exprT >
00469 >
00470 >
00471 operator^ ( xtl_wrap< Left_exprT > const& lhs_expr_, xtl_wrap< Right_exprT > const& rhs_expr_ )
00472 {
00473 typedef
00474 xtl_opbinconcat<
00475 xtl_wrap< Left_exprT >,
00476 xtl_wrap< Right_exprT >
00477 >
00478 opconcat_T;
00479
00480 return xtl_wrap< opconcat_T >( opconcat_T( lhs_expr_, rhs_expr_ ) );
00481 }
00482
00507 template< typename Left_exprT, typename Right_exprT >
00508 inline
00509 xtl_wrap<
00510 xtl_opbinminus<
00511 xtl_wrap< Left_exprT >,
00512 xtl_wrap< Right_exprT >
00513 >
00514 >
00515 operator- ( xtl_wrap< Left_exprT > const& lhs_expr_, xtl_wrap< Right_exprT > const& rhs_expr_ )
00516 {
00517 typedef
00518 xtl_opbinminus<
00519 xtl_wrap< Left_exprT >,
00520 xtl_wrap< Right_exprT >
00521 >
00522 opbinminus_T;
00523
00524 return xtl_wrap< opbinminus_T >( opbinminus_T( lhs_expr_, rhs_expr_ ) );
00525 }
00526
00551 template< typename Left_exprT, typename Right_exprT >
00552 inline
00553 xtl_wrap<
00554 xtl_opbinand<
00555 xtl_wrap< Left_exprT >,
00556 xtl_wrap< Right_exprT >
00557 >
00558 >
00559 operator& ( xtl_wrap< Left_exprT > const& lhs_expr_, xtl_wrap< Right_exprT > const& rhs_expr_ )
00560 {
00561 typedef
00562 xtl_opbinand<
00563 xtl_wrap< Left_exprT >,
00564 xtl_wrap< Right_exprT >
00565 >
00566 opbinand_T;
00567
00568 return xtl_wrap< opbinand_T >( opbinand_T( lhs_expr_, rhs_expr_ ) );
00569 }
00570
00571 }
00572
00573 #endif // _CTTL_XTL_OP_H_INCLUDED_