libzypp  17.8.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
 

Friends

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.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 Function Documentation

◆ operator<< [1/2]

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

Definition at line 52 of file SerialNumber.cc.

◆ operator<<() [2/2]

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

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: