lemon/counter.h
changeset 1863 12e0db6b7d0e
parent 1851 78b5ea23f0f1
child 1875 98698b69a902
equal deleted inserted replaced
1:022e314b93d3 2:cee8812cc43a
    69   public:
    69   public:
    70     typedef _SubNoCounter<_SubNoCounter<P> > SubCounter;
    70     typedef _SubNoCounter<_SubNoCounter<P> > SubCounter;
    71     typedef _SubNoCounter<_SubNoCounter<P> > SubNoCounter;
    71     typedef _SubNoCounter<_SubNoCounter<P> > SubNoCounter;
    72   
    72   
    73     _SubNoCounter(P &parent) :_parent(parent) {}
    73     _SubNoCounter(P &parent) :_parent(parent) {}
    74     _SubNoCounter(P &parent,std::string title,std::ostream &os=std::cerr) 
    74     _SubNoCounter(P &parent,std::string,std::ostream &) 
    75       :_parent(parent) {}
    75       :_parent(parent) {}
    76     _SubNoCounter(P &parent,const char *title,std::ostream &os=std::cerr)
    76     _SubNoCounter(P &parent,std::string) 
       
    77       :_parent(parent) {}
       
    78     _SubNoCounter(P &parent,const char *,std::ostream &)
       
    79       :_parent(parent) {}
       
    80     _SubNoCounter(P &parent,const char *)
    77       :_parent(parent) {}
    81       :_parent(parent) {}
    78     ~_SubNoCounter() {}
    82     ~_SubNoCounter() {}
    79     _SubNoCounter &operator++() { ++_parent; return *this;}
    83     _SubNoCounter &operator++() { ++_parent; return *this;}
    80     int operator++(int) { _parent++; return 0;}
    84     int operator++(int) { _parent++; return 0;}
    81     _SubNoCounter &operator--() { --_parent; return *this;}
    85     _SubNoCounter &operator--() { --_parent; return *this;}
    82     int operator--(int) { _parent--; return 0;}
    86     int operator--(int) { _parent--; return 0;}
    83     _SubNoCounter &operator+=(int c) { _parent+=c; return *this;}
    87     _SubNoCounter &operator+=(int c) { _parent+=c; return *this;}
    84     _SubNoCounter &operator-=(int c) { _parent-=c; return *this;}
    88     _SubNoCounter &operator-=(int c) { _parent-=c; return *this;}
    85     void reset(int c=0) {}
    89     void reset(int) {}
       
    90     void reset() {}
    86     operator int() {return 0;}
    91     operator int() {return 0;}
    87   };
    92   };
    88 
    93 
    89 
    94 
    90   /// \addtogroup timecount
    95   /// \addtogroup timecount
   152   public:
   157   public:
   153     typedef _SubNoCounter<NoCounter> SubCounter;
   158     typedef _SubNoCounter<NoCounter> SubCounter;
   154     typedef _SubNoCounter<NoCounter> SubNoCounter;
   159     typedef _SubNoCounter<NoCounter> SubNoCounter;
   155 
   160 
   156     NoCounter() {}
   161     NoCounter() {}
   157     NoCounter(std::string title,std::ostream &os=std::cerr) {}
   162     NoCounter(std::string,std::ostream &) {}
   158     NoCounter(const char *title,std::ostream &os=std::cerr) {}
   163     NoCounter(const char *,std::ostream &) {}
       
   164     NoCounter(std::string) {}
       
   165     NoCounter(const char *) {}
   159     NoCounter &operator++() { return *this; }
   166     NoCounter &operator++() { return *this; }
   160     int operator++(int) { return 0; }
   167     int operator++(int) { return 0; }
   161     NoCounter &operator--() { return *this; }
   168     NoCounter &operator--() { return *this; }
   162     int operator--(int) { return 0; }
   169     int operator--(int) { return 0; }
   163     NoCounter &operator+=(int c) { return *this;}
   170     NoCounter &operator+=(int) { return *this;}
   164     NoCounter &operator-=(int c) { return *this;}
   171     NoCounter &operator-=(int) { return *this;}
   165     void reset(int c=0) {}
   172     void reset(int) {}
       
   173     void reset() {}
   166     operator int() {return 0;}
   174     operator int() {return 0;}
   167   };
   175   };
   168 
   176 
   169   ///@}
   177   ///@}
   170 }
   178 }