libzypp  17.14.0
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 TInt>
28  class Counter
29  {
30  public:
31  Counter( TInt value_r = TInt(0) )
32  : _value( TInt( value_r ) )
33  {}
34 
35  operator TInt &()
36  { return _value; }
37 
38  operator const TInt &() const
39  { return _value; }
40 
41  public:
42  TInt _value;
43  };
45 
47 } // namespace zypp
49 #endif // ZYPP_BASE_COUNTER_H
TInt _value
Definition: Counter.h:42
Counter(TInt value_r=TInt(0))
Definition: Counter.h:31
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
Integral type with initial value 0.
Definition: Counter.h:28