Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

IntFun.h

Go to the documentation of this file.
00001 
00026 #ifndef __INTFUN_H
00027 #define __INTFUN_H
00028  
00029 #ifndef __INTFUNBASE_H
00030 #include "jbltools/sfh/IntFunBase.h"
00031 #endif /* #ifndef __INTFUNBASE_H */
00032 
00033 #include "jbltools/sfh/BaseCutBase.h"       // needed as base class of IntFunComp
00034 #include "jbltools/sfh/BaseCutPoR.h"        // needed for default argument 
00035 #include "jbltools/sfh/FillIteratorPoR.h"   // needed for default argument 
00036 #include "jbltools/sfh/FloatFunPoR.h"       // needed for default argument 
00037 #include "jbltools/sfh/IntFunPoR.h"          // needed for automagic conversion 
00038 #include "jbltools/sfh/ROListPoR.h"         // needed for automagic conversion 
00039 
00040 class FloatFun;
00041 
00042 // Class ConstIntFun
00044 class ConstIntFun : public IntFun {
00045   public: 
00047     explicit ConstIntFun (int c_,                  
00048                           const char *name_ = 0    
00049                          ) 
00050       : IntFun (name_ ? name_ : str(c_).c_str(), str(c_)), 
00051         c(c_) 
00052       {}
00053       
00055     explicit ConstIntFun (int c_,                    
00056                           const std::string& name_   
00057                          ) 
00058       : IntFun (name_, str(c_)), 
00059         c(c_) 
00060       {}
00061       
00063     virtual int operator() () const { return c; }
00064     
00065   protected:
00066     const int c;                   
00067 
00068     virtual ~ConstIntFun() {} 
00069 };
00070 
00071 
00072 //  Class IntFunComp:
00074 
00079 class  IntFunComp: public BaseCut {
00080   public:
00081     IntFunComp (const std::string& name_) : BaseCut (name_) {}
00082     virtual int lhsValue() const = 0; 
00083     virtual int rhsValue() const = 0; 
00084 };
00085 
00086 // External functions that implement arithmetic operators between
00087 // cut, so that we can write e.g. "funa + (funb * func)"
00088 
00090 
00091 IntFun& operator+ (const IntFun& lhs_, const IntFun& rhs_);
00092 
00094 
00095 IntFun& operator+ (int lhs_, const IntFun& rhs_);
00096 
00098 
00099 IntFun& operator+ (const IntFun& lhs_, int rhs_);
00100 
00102 
00103 IntFun& operator- (const IntFun& lhs_, const IntFun& rhs_);
00104 
00106 
00107 IntFun& operator- (int lhs_, const IntFun& rhs_);
00108 
00110 
00111 IntFun& operator- (const IntFun& lhs_, int rhs_);
00112 
00114 
00115 IntFun& operator- (const IntFun& arg_);
00116 
00118 
00119 IntFun& operator+ (IntFun& arg_);
00120 const IntFun& operator+ (const IntFun& arg_);
00121 
00123 
00124 IntFun& operator* (const IntFun& lhs_, const IntFun& rhs_);
00125 
00127 
00128 IntFun& operator/ (const IntFun& lhs_, const IntFun& rhs_);
00129 
00131 
00132 IntFun& operator* (int lhs_, const IntFun& rhs_);
00133 
00135 
00136 IntFun& operator* (const IntFun& lhs_, int rhs_);
00137 
00139 
00140 IntFun& operator/ (int lhs_, const IntFun& rhs_);
00141 
00143 
00144 IntFun& operator/ (const IntFun& lhs_, int rhs_);
00145 
00147 
00148 IntFun& operator& (const IntFun& lhs_, const IntFun& rhs_);
00149 
00151 
00152 IntFun& operator| (const IntFun& lhs_, const IntFun& rhs_);
00153 
00155 
00156 IntFun& operator^ (const IntFun& lhs_, const IntFun& rhs_);
00157 
00159 
00160 IntFun& operator& (const IntFun& lhs_, int rhs_);
00161 
00163 
00164 IntFun& operator& (int lhs_, const IntFun& rhs_);
00165 
00167 
00168 IntFun& operator| (const IntFun& lhs_, int rhs_);
00169 
00171 
00172 IntFun& operator| (int lhs_, const IntFun& rhs_);
00173 
00175 
00176 IntFun& operator^ (const IntFun& lhs_, int rhs_);
00177 
00179 
00180 IntFun& operator^ (int lhs_, const IntFun& rhs_);
00181 
00183 
00184 IntFun& operator~ (const IntFun&  arg_);
00185 
00187 
00188 IntFun& square (const IntFun& arg_);
00189 
00191 
00192 IntFun& abs (const IntFun& arg_);
00193 
00194 // External functions that implement comparison operators between
00195 // IntFun objects
00196 
00197 
00202 IntFunComp& operator< (const IntFun& lhs_, const IntFun& rhs_);
00203 
00208 IntFunComp& operator> (const IntFun& lhs_, const IntFun& rhs_);
00209 
00214 IntFunComp& operator<= (const IntFun& lhs_, const IntFun& rhs_);
00215 
00220 IntFunComp& operator>= (const IntFun& lhs_, const IntFun& rhs_);
00221 
00226 IntFunComp& operator== (const IntFun& lhs_, const IntFun& rhs_);
00227 
00232 IntFunComp& operator!= (const IntFun& lhs_, const IntFun& rhs_);
00233 
00234 // External functions that implement comparison operators between
00235 // a int and a IntFun object
00236 
00241 IntFunComp& operator< (int lhs_, const IntFun& rhs_);
00242 
00247 IntFunComp& operator<= (int lhs_, const IntFun& rhs_);
00248 
00253 IntFunComp& operator> (int lhs_, const IntFun& rhs_);
00254 
00259 IntFunComp& operator>= (int lhs_, const IntFun& rhs_);
00260 
00265 IntFunComp& operator== (int lhs_, const IntFun& rhs_);
00266 
00271 IntFunComp& operator!= (int lhs_, const IntFun& rhs_);
00272 
00273 // External functions that implement comparison operators between
00274 // a IntFun object and a int
00279 IntFunComp& operator< (const IntFun& lhs_, int rhs_);
00280 
00285 IntFunComp& operator<= (const IntFun& lhs_, int rhs_);
00286 
00291 IntFunComp& operator> (const IntFun& lhs_, int rhs_);
00292 
00297 IntFunComp& operator>= (const IntFun& lhs_, int rhs_);
00298 
00303 IntFunComp& operator== (const IntFun& lhs_, int rhs_);
00304 
00309 IntFunComp& operator!= (const IntFun& lhs_, int rhs_);
00310 
00311 
00312 // External functions that allow chain comparisons like 1 < x < y <= 15
00313 // Such a chain comparison is defined as
00314 // (1 < x) && (x < y) && (y <= 15)
00315 
00320 IntFunComp& operator< (const IntFunComp& lhs_, const IntFun& rhs_);
00321 
00326 IntFunComp& operator<= (const IntFunComp& lhs_, const IntFun& rhs_);
00327 
00332 IntFunComp& operator> (const IntFunComp& lhs_, const IntFun& rhs_);
00333 
00338 IntFunComp& operator>= (const IntFunComp& lhs_, const IntFun& rhs_);
00339 
00344 IntFunComp& operator== (const IntFunComp& lhs_, const IntFun& rhs_);
00345 
00350 IntFunComp& operator!= (const IntFunComp& lhs_, const IntFun& rhs_);
00351 
00356 IntFunComp& operator< (const IntFunComp& lhs_, int rhs_);
00361 IntFunComp& operator<= (const IntFunComp& lhs_, int rhs_);
00366 IntFunComp& operator> (const IntFunComp& lhs_, int rhs_);
00371 IntFunComp& operator>= (const IntFunComp& lhs_, int rhs_);
00376 IntFunComp& operator== (const IntFunComp& lhs_, int rhs_);
00381 IntFunComp& operator!= (const IntFunComp& lhs_, int rhs_);
00382 
00387 IntFun& max (const IntFunPoRConst&        fun,        
00388              const BaseCutPoRConst&       cut=0,      
00389              const FillIteratorPoR&       intiter=0,  
00390              const FillIteratorPoRConst&  extiter=0   
00391             );
00392 
00397 IntFun& min (const IntFunPoRConst&        fun,        
00398                     const BaseCutPoRConst&       cut=0,      
00399                     const FillIteratorPoR&       intiter=0,  
00400                     const FillIteratorPoRConst&  extiter=0   
00401                    );
00402 
00407 IntFun& sum (const IntFunPoRConst&        fun,        
00408                     const BaseCutPoRConst&       cut=0,      
00409                     const FillIteratorPoR&       intiter=0,  
00410                     const FillIteratorPoRConst&  extiter=0   
00411                    );
00412 
00417 IntFun& count (const BaseCutPoRConst&       cut=0,      
00418                       const FillIteratorPoR&       intiter=0,  
00419                       const FillIteratorPoRConst&  extiter=0   
00420                      );
00425 FloatFun& Float (const IntFun& arg);
00426 
00431 IntFun& cached (const ROListPoR&   rol,        
00432                 const IntFunPoR& fun,          
00433                 const FillIteratorPoR& iter=0  
00434                );
00435 
00436 #endif /* #ifndef __INTFUN_H */

Generated on Thu Oct 26 12:52:57 2006 for SFH by doxygen 1.3.2