filter_utils.h

00001 
00002 //      file            :       filter_utils.h
00003 //  copyright   :       (C) 2002-2004 Benjamin Kaufmann
00004 //  email               :       hume@c-plusplus.de
00005 //      internet        :       http://bens.c-plusplus.info/
00006 //
00007 //  Definition des Filter-Combiner-Interfaces
00009 #ifndef FILTER_UTILS_H_INCLUDED
00010 #define FILTER_UTILS_H_INCLUDED
00011 
00104 #include "detail/filter_utils_impl.h"
00105 namespace dirstr {
00136         template <class F>
00137         detail::expr<F> op(const F& f)
00138         {
00139                 return detail::expr<F>(f);
00140         }
00141 
00159         template <class E1, class E2>   
00160         detail::expr<detail::expr_binary_v<E1, E2, detail::and_op> >
00161         operator && (const detail::expr<E1>& e1, const detail::expr<E2>& e2) 
00162         {       
00163                 return detail::expr<detail::expr_binary_v<E1, E2, detail::and_op> >( 
00164                         detail::expr_binary_v<E1, E2, detail::and_op>(e1.f_, e2.f_) 
00165                 ); 
00166         } 
00167         
00177         template <class E1, class E2>
00178         detail::expr<detail::expr_binary_v<E1, E2, detail::or_op> >
00179         operator || (const detail::expr<E1>& e1, const detail::expr<E2>& e2)
00180         {
00181                 return detail::expr<detail::expr_binary_v<E1, E2, detail::or_op> >(
00182                         detail::expr_binary_v<E1, E2, detail::or_op>(e1.f_, e2.f_)
00183                 );
00184         }       
00185 
00195         template <class E1, class E2>
00196         detail::expr<detail::expr_binary_v<E1, E2, detail::xor_op> >
00197         operator ^ (const detail::expr<E1>& e1, const detail::expr<E2>& e2)
00198         {
00199                 return detail::expr<detail::expr_binary_v<E1, E2, detail::xor_op> >(
00200                         detail::expr_binary_v<E1, E2, detail::xor_op>(e1.f_, e2.f_)
00201                 );
00202         }       
00203 
00219         template <class E>
00220         detail::expr<detail::expr_not_v<E> >
00221         operator!(const detail::expr<E>& e)
00222         {
00223                 return detail::expr<detail::expr_not_v<E> >(
00224                         detail::expr_not_v<E>(e.f_)
00225                 );
00226         }
00227 
00237         template <class T>
00238         filter_base* expr_f(const dirstr::detail::expr<T>& e)
00239         {
00240                 return e.clone();
00241         }
00242 
00243 }       // namespace dirstr
00244 
00245 #endif
00246 

Generated on Fri Apr 27 13:12:36 2007 for Highlight Code Converter by  doxygen 1.5.2