Preface | p. xi |
Object-Oriented Programming in C | p. 1 |
Data Abstraction | p. 2 |
Objects and Messages | p. 3 |
OOP-Flavored Data Abstraction | p. 3 |
Classes and Objects | p. 5 |
Implementing Messages and Objects | p. 6 |
Inheritance | p. 8 |
Polymorphism and Virtual Functions | p. 12 |
Abstract Types and Code Reuse | p. 14 |
Class Hierarchies and Inheritance | p. 18 |
Single Inheritance | p. 18 |
Multiple Inheritance | p. 19 |
A Few Class-Hierarchy Design Issues | p. 20 |
Extensibility: Expanding the Language Definition | p. 24 |
Case Study: Making malloc () Safe for Democracy | p. 31 |
Case Study: A Linked-List Class in C | p. 39 |
List-Element-Manipulation Methods | p. 39 |
Class Derivation: Element Creation and Deletion | p. 45 |
List-Manipulation Methods | p. 48 |
List Creation and Destruction | p. 48 |
Finding List Elements | p. 49 |
Duplicating and Copying Lists | p. 49 |
Adding and Removing List Elements | p. 50 |
Printing the List | p. 51 |
Implementing the List Class | p. 51 |
Class Definitions | p. 51 |
Function Macros | p. 55 |
List and List-Element Destruction | p. 56 |
List and List-Element Creation | p. 57 |
Finding List Elements | p. 59 |
Adding and Removing List Elements | p. 61 |
Duplicating and Copying Lists | p. 62 |
Printing the List | p. 62 |
C++: Small Differences from C | p. 67 |
New Keywords | p. 68 |
End-of-Line Comments | p. 68 |
The Scope Operator (::) | p. 69 |
The const Storage Class | p. 69 |
The volatile Storage Class | p. 73 |
The inline Storage Class | p. 75 |
The char Type | p. 77 |
NULL and Zero | p. 77 |
void Pointers | p. 77 |
struct and union | p. 78 |
Variable Declarations | p. 80 |
Dynamic-Memory Allocation | p. 82 |
Function Prototypes and Forward References | p. 84 |
Default Arguments | p. 84 |
Function Definitions | p. 85 |
Function Pointers | p. 87 |
Function Overloading | p. 88 |
Function Templates | p. 93 |
Type-Safe Linkage | p. 97 |
References | p. 100 |
Reference Variables | p. 100 |
Reference Arguments | p. 102 |
Returning References | p. 104 |
Problems with References | p. 106 |
I/O Streams | p. 108 |
Simple Classes | p. 112 |
Classes as Black Boxes | p. 112 |
Member-Function (Method) Definitions | p. 113 |
Accessing Members: The this Pointer | p. 115 |
Access Protection | p. 119 |
Constructors | p. 120 |
The Default Constructor | p. 121 |
The Copy Constructor | p. 122 |
Type-Conversion Constructors | p. 125 |
Type-Conversion Default Constructors | p. 129 |
Constructors with Multiple Arguments | p. 132 |
Constructors and Control Flow | p. 132 |
Constructors and unions | p. 133 |
Destructors | p. 134 |
Arrays of Objects | p. 136 |
static Member Data and Functions | p. 137 |
const Member Data and Member-Initialization Lists | p. 139 |
Designating Member Functions for const Objects | p. 142 |
A Very Simple Example: The tracer Class | p. 144 |
Operator Overloading | p. 148 |
General Considerations in Operator Overloading | p. 148 |
Operator-Overload Definitions | p. 150 |
Type Conversion and Operator Overloads | p. 152 |
The operator++ () Function | p. 156 |
The operator () () and operator-] () Functions | p. 156 |
Lvalues and Rvalues | p. 157 |
Generated Temporaries | p. 160 |
Operators That Generate Lvalues | p. 161 |
Assignment Overloads | p. 163 |
Operators That Generate Rvalues | p. 165 |
The Scope of a Temporary | p. 171 |
Friends | p. 175 |
A Fixed-Point Arithmetic Package | p. 180 |
A Random-Number Class | p. 185 |
Accessing Two-Dimensional Types with operator () () | p. 188 |
Auxiliary Classes | p. 189 |
Accessing Two-Dimensional Types with operator [] () | p. 189 |
A Virtual-Memory Paging System | p. 192 |
Implementing Variant Records | p. 199 |
Overloading new and delete | p. 206 |
Derivation | p. 216 |
Relationships between Classes | p. 217 |
Instance Variables | p. 220 |
Object Copying and Instance Variables | p. 223 |
Inheritance and Derived Classes | p. 231 |
Type Conversion and Derived Classes | p. 235 |
Multiple Inheritance | p. 236 |
Initialization and Copying under Derivation | p. 239 |
Nested Classes | p. 244 |
Class Scope | p. 246 |
Inheritance and new and delete Overloads | p. 250 |
Virtual Base Classes | p. 252 |
Polymorphism and Virtual Functions | p. 257 |
Virtual Functions at the Implementation Level | p. 257 |
Virtual Functions: Basic Use | p. 262 |
When to Use Virtual Functions | p. 275 |
Static Binding and Virtual Functions | p. 276 |
Problems with a Default virtual in Derived Classes | p. 277 |
Virtual Constructors and Destructors | p. 278 |
Agreement between Base and Derived-Class Definitions | p. 281 |
Implementing a typeof () Function | p. 284 |
A Few More Implementation Issues | p. 287 |
Private Base Classes | p. 288 |
Member Pointers | p. 303 |
Container Classes and Templates | p. 311 |
An Example Class Library | p. 322 |
Using the Collection Classes | p. 322 |
The Collection Template Classes | p. 323 |
The collection-Class Hierarchy | p. 325 |
The lnode[type] and lnode c[cls] Templates | p. 328 |
The node and list node Classes | p. 331 |
The collection Class | p. 334 |
Refining and Simplifying the collection Interface | p. 343 |
Iterators | p. 348 |
Implementing the collection Class | p. 349 |
Preprocessor Directives | p. 349 |
The collection Definition | p. 350 |
Implementing the node Class | p. 360 |
Implementing the node iterator Class | p. 366 |
Implementing the list node Class | p. 370 |
Implementing the lnode[type] Template | p. 376 |
Implementing lnode c[type] | p. 383 |
Implementing iterator[type] and iterator c[cls] | p. 383 |
Implementing the Stack Classes and Templates | p. 388 |
The Queue Classes and Templates | p. 394 |
Implementing the Array Classes | p. 399 |
Conclusion | p. 403 |
Exception Handling | p. 408 |
Bibliography | p. 418 |
Index | p. 419 |
Table of Contents provided by Syndetics. All Rights Reserved. |