libzypp  13.10.6
SerialNumber.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 //#include "zypp/base/Logger.h"
14 
15 #include "zypp/base/SerialNumber.h"
16 
17 using std::endl;
18 
20 namespace zypp
21 {
22 
24  //
25  // CLASS NAME : SerialNumber
26  //
28 
30  //
31  // METHOD NAME : SerialNumber::SerialNumber
32  // METHOD TYPE : Ctor
33  //
35  : _dirty( dirty_r )
36  , _serial( 0 )
37  {}
38 
40  //
41  // METHOD NAME : SerialNumber::~SerialNumber
42  // METHOD TYPE : Dtor
43  //
45  {}
46 
47  /******************************************************************
48  **
49  ** FUNCTION NAME : operator<<
50  ** FUNCTION TYPE : std::ostream &
51  */
52  std::ostream & operator<<( std::ostream & str, const SerialNumber & obj )
53  {
54  return str << "SERIAL" << (obj._dirty?"*":"(") << obj._serial << (obj._dirty?"*":")");
55  }
56 
58  //
59  // CLASS NAME : SerialNumberWatcher
60  //
62 
64  //
65  // METHOD NAME : SerialNumberWatcher::SerialNumberWatcher
66  // METHOD TYPE : Ctor
67  //
69  : _serial( serial_r )
70  {}
71 
73  //
74  // METHOD NAME : SerialNumberWatcher::SerialNumberWatcher
75  // METHOD TYPE : Ctor
76  //
78  : _serial( serial_r.serial() )
79  {}
80 
82  //
83  // METHOD NAME : SerialNumber::~SerialNumber
84  // METHOD TYPE : Dtor
85  //
87  {}
88 
89  /******************************************************************
90  **
91  ** FUNCTION NAME : operator<<
92  ** FUNCTION TYPE : std::ostream &
93  */
94  std::ostream & operator<<( std::ostream & str, const SerialNumberWatcher & obj )
95  {
96  return str << "LAST_SERIAL(" << obj._serial << ")";
97  }
98 
100 } // namespace zypp
Simple serial number watcher.
Definition: SerialNumber.h:122
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:120
virtual ~SerialNumberWatcher()
Dtor.
Definition: SerialNumber.cc:86
SerialNumber(bool dirty_r=false)
Ctor taking initial dirty value.
Definition: SerialNumber.cc:34
Simple serial number provider.
Definition: SerialNumber.h:44
SerialNumberWatcher(unsigned serial_r=(unsigned)-1)
Ctor taking an initial serial value.
Definition: SerialNumber.cc:68
virtual ~SerialNumber()
Dtor.
Definition: SerialNumber.cc:44