/////////////////////////////////////////////////////////// // Softwarebauelemente I, Aufgabe O1.2 // // author: Stephan Brumme // last changes: January 14, 2001 #include "CashOffice.h" #include // compare the CashOffice with another one Boolean CCashOffice::operator==(const CCashOffice& cashOffice) const { // use the CRoom compare function return (CRoom::operator==(cashOffice) && m_nNumberOfCounter == cashOffice.m_nNumberOfCounter); } // compare the CashOffice with another one // routes call down to "==" operator Boolean CCashOffice::EqualValue(const CCashOffice& cashOffice) const { return (operator==(cashOffice)); } // copy one CashOffice to another one // prevents user from copying an object to itself CCashOffice& CCashOffice::operator=(const CCashOffice& cashOffice) { // cannot copy an object to itself if (this != &cashOffice) { // copy all variables // first copy the attributes of CRoom CRoom::operator=(cashOffice); // and now our new ones of CCashOffice m_nNumberOfCounter = cashOffice.m_nNumberOfCounter; } return *this; } // copy one CashOffice to another one // prevents user from copying an object to itself // calls "=" operator internally Boolean CCashOffice::Copy(const CCashOffice &cashOffice) { // cannot copy an object to itself if (this == &cashOffice) return false; // use "=" operator operator=(cashOffice); return true; } // retrieve the private value of m_nNumberOfCounter Ordinal CCashOffice::GetNumberOfCounter() const { return m_nNumberOfCounter; } // change private m_nNumberOfCounter void CCashOffice::SetNumberOfCounter(const Ordinal nNumberOfCounter) { m_nNumberOfCounter = nNumberOfCounter; } // display the attributes // only for internal purposes ! void CCashOffice::Show() const { // open namespace using namespace std; // display the crap using default output // the CRoom member variables CRoom::Show(); // and the CCashOffice ones cout << "The number of counter is "<