libzypp  11.13.5
zypp::SerialNumber Class Reference

Simple serial number provider. More...

#include <SerialNumber.h>

List of all members.

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)

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

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

Ctor taking initial dirty value.

Definition at line 34 of file SerialNumber.cc.

zypp::SerialNumber::~SerialNumber ( )
virtual

Dtor.

Definition at line 44 of file SerialNumber.cc.


Member Function Documentation

void zypp::SerialNumber::setDirty ( )
inline

Definition at line 55 of file SerialNumber.h.

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

Definition at line 59 of file SerialNumber.h.

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

Definition at line 62 of file SerialNumber.h.

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

Definition at line 65 of file SerialNumber.h.


Friends And Related Function Documentation

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

Definition at line 52 of file SerialNumber.cc.

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

Stream output

Definition at line 52 of file SerialNumber.cc.


Member Data Documentation

bool zypp::SerialNumber::_dirty
mutableprivate

Definition at line 76 of file SerialNumber.h.

unsigned zypp::SerialNumber::_serial
mutableprivate

Definition at line 77 of file SerialNumber.h.


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