Design Patterns : Elements of Reusable Object-Oriented Software


Design Patterns: Elements of Reusable Object-Oriented Software



Download 4,06 Mb.
Pdf ko'rish
bet279/288
Sana07.04.2022
Hajmi4,06 Mb.
#535140
1   ...   275   276   277   278   279   280   281   282   ...   288
Bog'liq
GOF Design Patterns

Design Patterns: Elements of Reusable Object-Oriented Software 
414 
Point& operator-=(const Point&); 
Point& operator*=(const Point&); 
Point& operator/=(const Point&); 
Point operator-();
friend bool operator==(const Point&, const Point&); 
friend bool operator!=(const Point&, const Point&); 
friend ostream& operator<<(ostream&, const Point&); 
friend istream& operator>>(istream&, Point&); 
}; 
The static member Zero represents Point(0, 0). 
Rect 
Rect represents an axis-aligned rectangle. ARect is defined by an origin point 
and an extent (thatis, width and height). The Rect operations areself-explanatory. 
class Rect { 
public: 
static const Rect Zero
Rect(Coord x, Coord y, Coord w, Coord h); 
Rect(const Point& origin, const Point& extent); 
Coord Width() const; void Width(Coord); 
Coord Height() const; void Height(Coord); 
Coord Left() const; void Left(Coord); 
Coord Bottom() const; void Bottom(Coord); 
Point& Origin() const; void Origin(const Point&); 
Point& Extent() const; void Extent(const Point&); 
void MoveTo(const Point&); 
void MoveBy(const Point&); 
bool IsEmpty() const; 
bool Contains(const Point&) const; 
}; 
The static member Zero is equivalent to the rectangle 


Design Patterns: Elements of Reusable Object-Oriented Software 
415 
Rect(Point(0, 0), Point(0, 0)); 


Design Patterns: Elements of Reusable Object-Oriented Software 
416 
Bibliography 
[Add94]
Addison-Wesley, Reading, MA. 
NEXTSTEPGeneral Reference: Release 3, 
Volumes 1 and 2
, 1994.
[AG90]
D.B. Anderson and S. Gossain. Hierarchyevolution and the software 
lifecycle. In 
TOOLS '90 ConferenceProceedings
, pages 41

50, Paris, June 1990. 
Prentice Hall.
[AIS+77]
Christopher Alexander, Sara Ishikawa, MurraySilverstein, Max Jacobson, 
Ingrid Fiksdahl-King, and Shlomo Angel.
A Pattern Language
. Oxford University 
Press, NewYork, 1977.

Download 4,06 Mb.

Do'stlaringiz bilan baham:
1   ...   275   276   277   278   279   280   281   282   ...   288




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish