libzypp  13.10.6
Counter.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_BASE_COUNTER_H
13 #define ZYPP_BASE_COUNTER_H
14 
15 #include <iosfwd>
16 
18 namespace zypp
19 {
20 
22  //
23  // CLASS NAME : Counter
24  //
27  template<class _IntT>
28  class Counter
29  {
30  public:
31  Counter( _IntT value_r = _IntT(0) )
32  : _value( _IntT( value_r ) )
33  {}
34 
35  operator _IntT &()
36  { return _value; }
37 
38  operator const _IntT &() const
39  { return _value; }
40 
41  public:
42  _IntT _value;
43  };
45 
47 } // namespace zypp
49 #endif // ZYPP_BASE_COUNTER_H
_IntT _value
Definition: Counter.h:42
Integral type with initial value 0.
Definition: Counter.h:28