libzypp  17.16.0
zypp::SerialNumber Class Reference

Simple serial number provider. More...

#include <SerialNumber.h>

Public Member Functions

 SerialNumber (bool dirty_r=false)
 Ctor taking initial dirty value. More...
virtual ~SerialNumber ()
 Dtor. More...
void setDirty ()
bool dirty () const
bool clean () const
unsigned serial () const

Private Attributes

bool _dirty
unsigned _serial


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

Related Functions

(Note that these are not member functions.)

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

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.

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)

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()

zypp::SerialNumber::~SerialNumber ( )


Definition at line 44 of file

Member Function Documentation

◆ setDirty()

void zypp::SerialNumber::setDirty ( )

Definition at line 55 of file SerialNumber.h.

◆ dirty()

bool zypp::SerialNumber::dirty ( ) const

Definition at line 59 of file SerialNumber.h.

◆ clean()

bool zypp::SerialNumber::clean ( ) const

Definition at line 62 of file SerialNumber.h.

◆ serial()

unsigned zypp::SerialNumber::serial ( ) const

Definition at line 65 of file SerialNumber.h.

Friends And Related Function Documentation

◆ operator<< [1/2]

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

Definition at line 52 of file

◆ operator<<() [2/2]

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

Stream output

Definition at line 52 of file

Member Data Documentation

◆ _dirty

bool zypp::SerialNumber::_dirty

Definition at line 76 of file SerialNumber.h.

◆ _serial

unsigned zypp::SerialNumber::_serial

Definition at line 77 of file SerialNumber.h.

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