element_ops.hh

Go to the documentation of this file.
00001 // element_ops.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2001, 2002, 2003, 2004 The Vaucanson Group.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
00016 //
00017 #ifndef VCSN_DESIGN_PATTERN_ELEMENT_OPS_HH
00018 # define VCSN_DESIGN_PATTERN_ELEMENT_OPS_HH
00019 
00029 # include <vaucanson/design_pattern/element_op_traits.hh>
00030 
00031 namespace vcsn {
00032 
00036   /*-------------------.
00037   | Ordered comparison |
00038   `-------------------*/
00039 
00041   template<typename S1, typename T1, typename S2, typename T2>
00042   static
00043   bool operator<(const vcsn::Element<S1, T1>& e1,
00044                  const vcsn::Element<S2, T2>& e2);
00045 
00047   template<typename S1, typename T1, typename S2, typename T2>
00048   static
00049   bool operator>(const vcsn::Element<S1, T1>& e1,
00050                  const vcsn::Element<S2, T2>& e2);
00051 
00053   template<typename S1, typename T1, typename S2, typename T2>
00054   static
00055   bool operator<=(const vcsn::Element<S1, T1>& e1,
00056                   const vcsn::Element<S2, T2>& e2);
00057 
00059   template<typename S1, typename T1, typename S2, typename T2>
00060   static
00061   bool operator>=(const vcsn::Element<S1, T1>& e1,
00062                   const vcsn::Element<S2, T2>& e2);
00063 
00065   template<typename S, typename T, typename U>
00066   static
00067   bool operator <(const vcsn::Element<S, T>& e,
00068                   const U& v);
00069 
00071   template<typename S, typename T, typename U>
00072   static
00073   bool operator >(const vcsn::Element<S, T>& e,
00074                   const U& v);
00075 
00077   template<typename S, typename T, typename U>
00078   static
00079   bool operator >=(const vcsn::Element<S, T>& e,
00080                    const U& v);
00081 
00083   template<typename S, typename T, typename U>
00084   static
00085   bool operator <=(const vcsn::Element<S, T>& e,
00086                    const U& v);
00087 
00089   template<typename U, typename S, typename T>
00090   static
00091   bool operator <(const U& v,
00092                   const vcsn::Element<S, T>& e);
00093 
00095   template<typename U, typename S, typename T>
00096   static
00097   bool operator >(const U& v,
00098                   const vcsn::Element<S, T>& e);
00099 
00101   template<typename U, typename S, typename T>
00102   static
00103   bool operator >=(const U& v,
00104                    const vcsn::Element<S, T>& e);
00105 
00107   template<typename U, typename S, typename T>
00108   static
00109   bool operator <=(const U& v,
00110                    const vcsn::Element<S, T>& e);
00111 
00112   /*---------.
00113   | Equality |
00114   `---------*/
00115 
00117   template<typename S1, typename T1, typename S2, typename T2>
00118   static
00119   bool operator ==(const vcsn::Element<S1, T1>& e1,
00120                   const vcsn::Element<S2, T2>& e2);
00121 
00123   template<typename S, typename T, typename U>
00124   static
00125   bool operator ==(const vcsn::Element<S, T>& e,
00126                    const U& v);
00127 
00129   template<typename U, typename S, typename T>
00130   static
00131   bool operator ==(const U& v,
00132                    const vcsn::Element<S, T>& e);
00133 
00134   /*-----------.
00135   | Difference |
00136   `-----------*/
00137 
00139   template<typename S1, typename T1, typename S2, typename T2>
00140   static
00141   bool operator !=(const vcsn::Element<S1, T1>& e1,
00142                   const vcsn::Element<S2, T2>& e2);
00143 
00145   template<typename S, typename T, typename U>
00146   static
00147   bool operator !=(const vcsn::Element<S, T>& e,
00148                    const U& v);
00149 
00151   template<typename U, typename S, typename T>
00152   static
00153   bool operator !=(const U& v,
00154                    const vcsn::Element<S, T>& e);
00155 
00156   /*---------.
00157   | Addition |
00158   `---------*/
00159 
00161   template<typename S1, typename T1, typename S2, typename T2>
00162   static
00163   typename vcsn::op_add_traits<S1, S2, T1, T2>::ret_t
00164   operator+(const vcsn::Element<S1, T1>& e1,
00165             const vcsn::Element<S2, T2>& e2);
00166 
00168   template<typename S, typename T, typename U>
00169   static vcsn::Element<S, T>
00170   operator +(const vcsn::Element<S, T>& e,
00171              const U& v);
00172 
00174   template<typename U, typename S, typename T>
00175   static vcsn::Element<S, T>
00176   operator +(const U& v,
00177              const vcsn::Element<S, T>& e);
00178 
00179   /*-------------.
00180   | Substraction |
00181   `-------------*/
00182 
00184   template<typename S1, typename T1, typename S2, typename T2>
00185   static
00186   typename vcsn::op_sub_traits<S1, S2, T1, T2>::ret_t
00187   operator-(const vcsn::Element<S1, T1>& e1,
00188             const vcsn::Element<S2, T2>& e2);
00189 
00191   template<typename S, typename T, typename U>
00192   static vcsn::Element<S, T>
00193   operator-(const vcsn::Element<S, T>& e,
00194             const U& v);
00195 
00197   template<typename U, typename S, typename T>
00198   static vcsn::Element<S, T>
00199   operator-(const U& v,
00200             const vcsn::Element<S, T>& e);
00201 
00202   /*---------------.
00203   | Multiplication |
00204   `---------------*/
00205 
00207   template<typename S1, typename T1, typename S2, typename T2>
00208   static
00209   typename vcsn::op_mul_traits<S1, S2, T1, T2>::ret_t
00210   operator*(const vcsn::Element<S1, T1>& e1,
00211             const vcsn::Element<S2, T2>& e2);
00212 
00214   template<typename S, typename T, typename U>
00215   static vcsn::Element<S, T>
00216   operator*(const vcsn::Element<S, T>& e,
00217             const U& v);
00218 
00220   template<typename U, typename S, typename T>
00221   static vcsn::Element<S, T>
00222   operator*(const U& v,
00223             const vcsn::Element<S, T>& e);
00224 
00225   /*---------.
00226   | Division |
00227   `---------*/
00228 
00230   template<typename S1, typename T1, typename S2, typename T2>
00231   static
00232   typename vcsn::op_div_traits<S1, S2, T1, T2>::ret_t
00233   operator/(const vcsn::Element<S1, T1>& e1,
00234             const vcsn::Element<S2, T2>& e2);
00235 
00237   template<typename S, typename T, typename U>
00238   static vcsn::Element<S, T>
00239   operator/(const vcsn::Element<S, T>& e,
00240             const U& v);
00241 
00243   template<typename U, typename S, typename T>
00244   static vcsn::Element<S, T>
00245   operator/(const U& v,
00246             const vcsn::Element<S, T>& e);
00247 
00248   /*--------.
00249   | Modulus |
00250   `--------*/
00251 
00253   template<typename S1, typename T1, typename S2, typename T2>
00254   static
00255   typename vcsn::op_mod_traits<S1, S2, T1, T2>::ret_t
00256   operator%(const vcsn::Element<S1, T1>& e1,
00257             const vcsn::Element<S2, T2>& e2);
00258 
00260   template<typename S, typename T, typename U>
00261   static vcsn::Element<S, T>
00262   operator%(const vcsn::Element<S, T>& e,
00263             const U& v);
00264 
00266   template<typename U, typename S, typename T>
00267   static vcsn::Element<S, T>
00268   operator%(const U& v,
00269             const vcsn::Element<S, T>& e);
00270 
00271   /*---------------.
00272   | Unary negation |
00273   `---------------*/
00274 
00276   template<typename S, typename T>
00277   static vcsn::Element<S, T>
00278   operator -(const vcsn::Element<S, T>&);
00279 
00280   /*-----------------.
00281   | Input and Output |
00282   `-----------------*/
00283 
00285   template<typename St, typename S, typename T>
00286   static St&
00287   operator <<(St& s, const vcsn::Element<S, T>& e);
00288 
00290   template<typename St, typename S, typename T>
00291   static St&
00292   operator >>(St& s, const vcsn::Element<S, T>& e);
00293 
00294   // This operator does not exist.
00295 
00296 //   template<typename S1, typename T1, typename S2, typename T2>
00297 //   static void /* do not use or specialize */
00298 //   operator <<(const vcsn::Element<S1, T1>& e1,
00299 //            const vcsn::Element<S2, T2>& e2);
00300 
00301 
00305 } // vcsn
00306 
00307 namespace std {
00308 
00312   /*-----.
00313   | Swap |
00314   `-----*/
00315 
00320   template<typename S, typename T1, typename T2>
00321   void swap(vcsn::Element<S, T1>& e1,
00322             vcsn::Element<S, T2>& e2);
00323 
00325   template<typename S, typename T>
00326   void swap(vcsn::Element<S, T>& e1, T& v2);
00327 
00329   template<typename T, typename S>
00330   void swap(T& v1, vcsn::Element<S, T>& e2);
00331 
00335 } // std
00336 
00337 # ifndef VCSN_USE_INTERFACE_ONLY
00338 #  include <vaucanson/design_pattern/element_ops.hxx>
00339 # endif // VCSN_USE_INTERFACE_ONLY
00340 
00341 #endif // ! VCSN_DESIGN_PATTERN_ELEMENT_OPS_HH

Generated on Fri Jul 28 12:18:31 2006 for Vaucanson by  doxygen 1.4.6