sources:
BasicClass.cpp (550 bytes)
BasicClass.h (1.4k)
Date.cpp (3.8k)
Date.h (2.2k)
House.cpp (4.9k)
House.h (2.4k)
O2_1.cpp (619 bytes)
Room.cpp (2.3k)
Room.h (1.4k)


website:
more info here
studies/bauelemente/Softwarebauelemente-CodeO2-1/Room.h
download file

  1 ///////////////////////////////////////////////////////////
  2 // Softwarebauelemente II, Aufgabe O2.1
  3 //
  4 // author: Stephan Brumme
  5 // last changes: February 26, 2001
  6
  7 #if !defined(AFX_ROOM_H__34138CE0_E97C_11D4_9BB7_8BA1BD2C3421__INCLUDED_)
  8 #define AFX_ROOM_H__34138CE0_E97C_11D4_9BB7_8BA1BD2C3421__INCLUDED_
  9
 10 #if _MSC_VER > 1000
 11 #pragma once
 12 #endif // _MSC_VER > 1000
 13
 14
 15 // for basic class behaviour
 16 #include "BasicClass.h"
 17
 18
 19 // declare class CRoom
 20 class CRoom  : public CBasicClass {
 21 public:
 22     // constructor (former Init)
 23     CRoom(int nNumberOfRoom, int nArea);
 24
 25     // return class name
 26     static char* ClassnameOf() { return "CRoom"; }
 27
 28     // display the attributes
 29     friend ostream& operator<<(ostream &mystream, const CRoom& room);
 30    
 31     // compare two rooms
 32     bool operator==(const CRoom &room) const;
 33     virtual bool EqualValue(const CRoom* room) const;
 34
 35     // copy one room to another one
 36     CRoom&  operator=(const CRoom &room);
 37     virtual bool Copy(const CRoom* room);
 38    
 39     // access m_nNumberOfRoom
 40     int  GetNumberOfRoom() const;
 41     void SetNumberOfRoom(const int nNumberOfRoom);
 42    
 43     // retrieve covered area
 44     int GetArea() const;
 45
 46 protected:
 47     // used to perform proper display in derived classes
 48     virtual ostream& OutStream(ostream& mystream, bool bDebug=false) const;
 49
 50 private:
 51     // hide the member variables
 52     int m_nNumberOfRoom;
 53     int m_nArea;
 54 };
 55
 56 #endif // !defined(AFX_ROOM_H__34138CE0_E97C_11D4_9BB7_8BA1BD2C3421__INCLUDED_)
 57
 58