Skip to Content
Design Patterns: Elements of Reusable Object-Oriented Software
book

Design Patterns: Elements of Reusable Object-Oriented Software

by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
October 1994
Intermediate to advanced
416 pages
10h 26m
English
Addison-Wesley Professional
Content preview from Design Patterns: Elements of Reusable Object-Oriented Software

Appendix C. Foundation Classes

This appendix documents the foundation classes we use in the C++ sample code of several design patterns. We’ve intentionally kept the classes simple and minimal. We describe the following classes:

List, an ordered list of objects.

Iterator, the interface for accessing an aggregate’s objects in a sequence.

ListIterator, an iterator for traversing a List.

Point, a two-dimensional point.

Rect, an axis-aligned rectangle.

Some newer C++ standard types may not be available on all compilers. In particular, if your compiler doesn’t define bool, then define it manually as

image

C.1 List

The List class template provides ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First Design Patterns, 2nd Edition

Head First Design Patterns, 2nd Edition

Eric Freeman, Elisabeth Robson

Publisher Resources

ISBN: 0201633612Purchase book