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

FillIterators.h

Go to the documentation of this file.
00001 
00005 #ifndef __FILLITERATORS_H
00006 #define __FILLITERATORS_H
00007 
00008 #include "jbltools/sfh/FillIterator.h"
00009 
00010 //  Class RangeIterator:
00012 
00021 class RangeIterator: public FillIterator {
00022   public:
00024     RangeIterator (int min_,                  
00025                    int max_                   
00026                   )
00027     : FillIterator (str(min_)+"..."+str(max_)),
00028       min (min_), 
00029       max (max_), 
00030       index (min_)  
00031     {}            
00032     RangeIterator (int min_,                  
00033                    int max_,                  
00034                    const std::string& name_   
00035                                       )
00036     : FillIterator (name_),
00037       min (min_), 
00038       max (max_), 
00039       index (min_)  
00040     {}            
00042     virtual int operator() () const {
00043       return index;
00044     }   
00046     virtual bool next() {
00047       return (++index <= max);
00048     } 
00050     virtual bool reset() {
00051       index = min;
00052       return index <= max;
00053     }              
00055     virtual bool isValid() const {
00056       return (index >= min) && (index <= max);
00057     }              
00058     
00059   protected:
00061     virtual ~RangeIterator() {}
00062   private:
00063     // Data members
00064     int min;     
00065     int max;     
00066     int index;   
00067 };
00068 
00069 
00070 #endif /* #ifndef __FILLITERATORS_H */

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