libzypp: zyppng::SerialNumber Class Reference

libzypp 17.38.6

zyppng::SerialNumber Class Reference

Simple serial number provider. More...

`#include <zypp/base/SerialNumber.h>`

## Public Member Functions
| SerialNumber (bool dirty_r=false)
| Ctor taking initial `dirty` value.
virtual | ~SerialNumber ()
| Dtor.
void | setDirty ()
bool | dirty () const
bool | clean () const
unsigned | serial () const

## Private Attributes
bool | _dirty
unsigned | _serial

## Friends
std::ostream & | operator<< (std::ostream &str, const SerialNumber &obj)
| relates: SerialNumber Stream output

## Detailed Description

Simple serial number provider.

serial returns a serial number. The number returned stays the same unless setDirty was called to bring the object into `dirty` state. The next call to serial will increment the serial number and bring the object into `clean` state.

SerialNumber sno;
sno.serial(); // SERIAL(0); () = clean
sno.setDirty(); // SERIAL*0*; ** = dirty
sno.serial(); // SERIAL(1)
sno.setDirty(); // SERIAL*1*
sno.setDirty(); // SERIAL*1*
sno.serial(); // SERIAL(2)
zypp::SerialNumber::setDirty
void setDirty()
Definition SerialNumber.h:55
zypp::SerialNumber::serial
unsigned serial() const
Definition SerialNumber.h:65
zyppng::SerialNumber::SerialNumber
SerialNumber(bool dirty_r=false)
Ctor taking initial dirty value.
Definition SerialNumber.cc:34

Definition at line 44 of file SerialNumber.h.

## Constructor & Destructor Documentation

## ◆ SerialNumber()

zypp::SerialNumber::SerialNumber | ( | bool | dirty_r = false | ) |

Ctor taking initial `dirty` value.

Definition at line 34 of file SerialNumber.cc.

## ◆ ~SerialNumber()

zypp::SerialNumber::~SerialNumber | ( |  | ) |
| virtual

Dtor.

Definition at line 44 of file SerialNumber.cc.

## Member Function Documentation

## ◆ setDirty()

void zypp::SerialNumber::setDirty | ( |  | ) |
| inline

Definition at line 55 of file SerialNumber.h.

## ◆ dirty()

bool zypp::SerialNumber::dirty | ( |  | ) | const
| inline

Definition at line 59 of file SerialNumber.h.

## ◆ clean()

bool zypp::SerialNumber::clean | ( |  | ) | const
| inline

Definition at line 62 of file SerialNumber.h.

## ◆ serial()

unsigned zypp::SerialNumber::serial | ( |  | ) | const
| inline

Definition at line 65 of file SerialNumber.h.

## Friends And Related Symbol Documentation

## ◆ operator<<

std::ostream & operator<< | ( | std::ostream & | str,
|  | const SerialNumber & | obj )
| friend

relates: SerialNumber Stream output

Definition at line 52 of file SerialNumber.cc.

## Member Data Documentation

## ◆ _dirty

bool zypp::SerialNumber::_dirty
| mutableprivate

Definition at line 76 of file SerialNumber.h.

## ◆ _serial

unsigned zypp::SerialNumber::_serial
| mutableprivate

Definition at line 77 of file SerialNumber.h.

The documentation for this class was generated from the following files:

- zypp/base/SerialNumber.h
- zypp/base/SerialNumber.cc