| Introduction |
|
xxv | |
| Part I: Introduction to Professional C++ |
|
|
Chapter 1 A Crash Course In C++ |
|
|
3 | (46) |
|
|
|
3 | (21) |
|
The Obligatory Hello, World |
|
|
4 | (3) |
|
|
|
7 | (1) |
|
|
|
8 | (3) |
|
|
|
11 | (2) |
|
|
|
13 | (3) |
|
|
|
16 | (3) |
|
|
|
19 | (1) |
|
|
|
20 | (2) |
|
|
|
22 | (2) |
|
|
|
24 | (1) |
|
|
|
24 | (9) |
|
Pointers and Dynamic Memory |
|
|
24 | (4) |
|
|
|
28 | (1) |
|
|
|
29 | (1) |
|
|
|
30 | (1) |
|
|
|
31 | (2) |
|
C++ as an Object-Oriented Language |
|
|
33 | (2) |
|
|
|
33 | (2) |
|
|
|
35 | (2) |
|
Your First Useful C++ Program |
|
|
37 | (10) |
|
An Employee Records System |
|
|
37 | (1) |
|
|
|
37 | (4) |
|
|
|
41 | (3) |
|
|
|
44 | (3) |
|
|
|
47 | (1) |
|
|
|
47 | (2) |
|
Chapter 2 Designing Professional C++ Programs |
|
|
49 | (28) |
|
What Is Programming Design? |
|
|
50 | (1) |
|
The Importance of Programming Design |
|
|
50 | (2) |
|
What's Different about C++ Design? |
|
|
52 | (1) |
|
|
|
53 | (4) |
|
|
|
54 | (1) |
|
|
|
55 | (2) |
|
|
|
57 | (11) |
|
|
|
57 | (1) |
|
Deciding Whether or Not to Reuse Code |
|
|
58 | (2) |
|
Strategies for Reusing Code |
|
|
60 | (5) |
|
Bundling Third-Party Applications |
|
|
65 | (1) |
|
|
|
66 | (1) |
|
|
|
67 | (1) |
|
Designing with Patterns and Techniques |
|
|
68 | (1) |
|
Designing a Chess Program |
|
|
69 | (6) |
|
|
|
69 | (1) |
|
|
|
69 | (6) |
|
|
|
75 | (2) |
|
Chapter 3 Designing With Objects |
|
|
77 | (20) |
|
Am I Thinking Procedurally? |
|
|
78 | (1) |
|
The Object-Oriented Philosophy |
|
|
78 | (3) |
|
|
|
78 | (1) |
|
|
|
79 | (1) |
|
|
|
79 | (1) |
|
|
|
80 | (1) |
|
|
|
80 | (1) |
|
Living in a World of Objects |
|
|
81 | (2) |
|
|
|
81 | (1) |
|
|
|
82 | (1) |
|
|
|
83 | (9) |
|
|
|
83 | (1) |
|
The Is-A Relationship (Inheritance) |
|
|
84 | (2) |
|
The Fine Line between Has-A and Is-A |
|
|
86 | (3) |
|
|
|
89 | (1) |
|
|
|
90 | (1) |
|
|
|
91 | (1) |
|
|
|
92 | (1) |
|
|
|
92 | (4) |
|
Interface versus Implementation |
|
|
93 | (1) |
|
Deciding on an Exposed Interface |
|
|
93 | (2) |
|
Designing a Successful Abstraction |
|
|
95 | (1) |
|
|
|
96 | (1) |
|
Chapter 4 Designing For Reuse |
|
|
97 | (14) |
|
|
|
97 | (1) |
|
How to Design Reusable Code |
|
|
98 | (12) |
|
|
|
99 | (1) |
|
Structure Your Code for Optimal Reuse |
|
|
100 | (4) |
|
|
|
104 | (5) |
|
Reconciling Generality and Ease of Use |
|
|
109 | (1) |
|
|
|
110 | (1) |
|
Chapter 5 Coding With Style |
|
|
111 | (22) |
|
The Importance of Looking Good |
|
|
111 | (1) |
|
|
|
112 | (1) |
|
|
|
112 | (1) |
|
|
|
112 | (8) |
|
Reasons to Write Comments |
|
|
112 | (4) |
|
|
|
116 | (4) |
|
|
|
120 | (1) |
|
|
|
120 | (2) |
|
Decomposition through Refactoring |
|
|
121 | (1) |
|
|
|
121 | (1) |
|
Decomposition in This Book |
|
|
122 | (1) |
|
|
|
122 | (3) |
|
|
|
122 | (1) |
|
|
|
123 | (2) |
|
Using Language Features with Style |
|
|
125 | (1) |
|
|
|
125 | (1) |
|
Use References Instead of Pointers |
|
|
125 | (1) |
|
|
|
126 | (1) |
|
|
|
126 | (2) |
|
The Curly Brace Alignment Debate |
|
|
126 | (2) |
|
Coming to Blows over Spaces and Parentheses |
|
|
128 | (1) |
|
|
|
128 | (1) |
|
|
|
128 | (1) |
|
|
|
129 | (4) |
| Part II: C++ Coding the Professional Way |
|
|
Chapter 6 Gaining Proficiency With Classes And Objects |
|
|
133 | (36) |
|
Introducing the Spreadsheet Example |
|
|
134 | (1) |
|
|
|
134 | (8) |
|
|
|
134 | (3) |
|
|
|
137 | (4) |
|
|
|
141 | (1) |
|
|
|
142 | (25) |
|
|
|
143 | (17) |
|
|
|
160 | (2) |
|
|
|
162 | (3) |
|
Distinguishing Copying from Assignment |
|
|
165 | (2) |
|
|
|
167 | (2) |
|
Chapter 7 Mastering Classes And Objects |
|
|
169 | (42) |
|
Dynamic Memory Allocation in Objects |
|
|
169 | (12) |
|
|
|
170 | (2) |
|
Freeing Memory with Destructors |
|
|
172 | (1) |
|
Handling Copying and Assignment |
|
|
172 | (9) |
|
Different Kinds of Data Members |
|
|
181 | (5) |
|
|
|
181 | (2) |
|
|
|
183 | (1) |
|
|
|
184 | (1) |
|
const Reference Data Members |
|
|
185 | (1) |
|
|
|
186 | (6) |
|
|
|
186 | (1) |
|
|
|
186 | (2) |
|
|
|
188 | (2) |
|
|
|
190 | (1) |
|
|
|
191 | (1) |
|
|
|
192 | (2) |
|
Enumerated Types Inside Classes |
|
|
194 | (1) |
|
|
|
195 | (2) |
|
|
|
197 | (9) |
|
Example: Implementing Addition for SpreadsheetCells |
|
|
197 | (5) |
|
Overloading Arithmetic Operators |
|
|
202 | (2) |
|
Overloading Comparison Operators |
|
|
204 | (2) |
|
Building Types with Operator Overloading |
|
|
206 | (1) |
|
Building Stable Interfaces |
|
|
206 | (4) |
|
Using Interface and Implementation Classes |
|
|
206 | (4) |
|
|
|
210 | (1) |
|
Chapter 8 Discovering Inheritance Techniques |
|
|
211 | (56) |
|
Building Classes with Inheritance |
|
|
211 | (8) |
|
|
|
212 | (3) |
|
|
|
215 | (4) |
|
|
|
219 | (4) |
|
The WeatherPrediction Class |
|
|
219 | (1) |
|
Adding Functionality in a Subclass |
|
|
220 | (2) |
|
Replacing Functionality in a Subclass |
|
|
222 | (1) |
|
|
|
223 | (7) |
|
|
|
223 | (1) |
|
|
|
224 | (2) |
|
Referring to Parent Names |
|
|
226 | (3) |
|
|
|
229 | (1) |
|
Inheritance for Polymorphism |
|
|
230 | (9) |
|
Return of the Spreadsheet |
|
|
230 | (1) |
|
Designing the Polymorphic Spreadsheet Cell |
|
|
231 | (1) |
|
The Spreadsheet Cell Base Class |
|
|
231 | (2) |
|
The Individual Subclasses |
|
|
233 | (3) |
|
|
|
236 | (1) |
|
|
|
237 | (2) |
|
|
|
239 | (4) |
|
Inheriting from Multiple Classes |
|
|
239 | (1) |
|
Naming Collisions and Ambiguous Base Classes |
|
|
240 | (3) |
|
Interesting and Obscure Inheritance Issues |
|
|
243 | (23) |
|
Changing the Overridden Method's Characteristics |
|
|
243 | (4) |
|
|
|
247 | (4) |
|
Special Cases in Overriding Methods |
|
|
251 | (7) |
|
Copy Constructors and the Equals Operator in Subclasses |
|
|
258 | (1) |
|
|
|
259 | (4) |
|
|
|
263 | (1) |
|
|
|
264 | (1) |
|
|
|
265 | (1) |
|
|
|
266 | (1) |
|
Chapter 9 Understanding C++ Quirks And Oddities |
|
|
267 | (50) |
|
|
|
268 | (14) |
|
|
|
268 | (3) |
|
|
|
271 | (1) |
|
|
|
271 | (2) |
|
|
|
273 | (1) |
|
Deciding between References and Pointers |
|
|
273 | (4) |
|
|
|
277 | (5) |
|
|
|
282 | (10) |
|
|
|
282 | (6) |
|
|
|
288 | (4) |
|
Order of Initialization of Nonlocal Variables |
|
|
292 | (1) |
|
|
|
292 | (8) |
|
|
|
292 | (2) |
|
typedefs for Function Pointers |
|
|
294 | (1) |
|
|
|
295 | (1) |
|
|
|
296 | (4) |
|
|
|
300 | (1) |
|
|
|
301 | (9) |
|
|
|
302 | (2) |
|
Alternative Function Syntax |
|
|
304 | (1) |
|
|
|
304 | (1) |
|
|
|
305 | (1) |
|
|
|
306 | (1) |
|
Explicit Conversion Operators |
|
|
306 | (2) |
|
|
|
308 | (1) |
|
|
|
308 | (2) |
|
|
|
310 | (2) |
|
|
|
312 | (4) |
|
Variable-Length Argument Lists |
|
|
312 | (2) |
|
|
|
314 | (2) |
|
|
|
316 | (1) |
|
Chapter 10 Handling Errors |
|
|
317 | (44) |
|
|
|
317 | (3) |
|
What Are Exceptions, Anyway? |
|
|
318 | (1) |
|
Why Exceptions in C++ Are a Good Thing |
|
|
318 | (2) |
|
Why Exceptions in C++ Are a Bad Thing |
|
|
320 | (1) |
|
|
|
320 | (1) |
|
|
|
320 | (16) |
|
Throwing and Catching Exceptions |
|
|
321 | (3) |
|
|
|
324 | (2) |
|
Throwing and Catching Multiple Exceptions |
|
|
326 | (3) |
|
|
|
329 | (2) |
|
|
|
331 | (5) |
|
Exceptions and Polymorphism |
|
|
336 | (8) |
|
The Standard Exception Hierarchy |
|
|
336 | (1) |
|
Catching Exceptions in a Class Hierarchy |
|
|
337 | (2) |
|
Writing Your Own Exception Classes |
|
|
339 | (3) |
|
|
|
342 | (2) |
|
Stack Unwinding and Cleanup |
|
|
344 | (3) |
|
|
|
346 | (1) |
|
Catch, Cleanup, and Rethrow |
|
|
346 | (1) |
|
Common Error-Handling Issues |
|
|
347 | (8) |
|
|
|
347 | (3) |
|
|
|
350 | (2) |
|
Function-Try-Blocks for Constructors |
|
|
352 | (2) |
|
|
|
354 | (1) |
|
|
|
355 | (4) |
|
|
|
359 | (2) |
|
Chapter 11 Delving Into The Standard Library |
|
|
361 | (24) |
|
|
|
362 | (4) |
|
|
|
362 | (4) |
|
Use of Operator Overloading |
|
|
366 | (1) |
|
Overview of the C++ Standard Library |
|
|
366 | (18) |
|
|
|
366 | (1) |
|
|
|
366 | (1) |
|
|
|
367 | (1) |
|
|
|
367 | (1) |
|
|
|
367 | (1) |
|
|
|
368 | (1) |
|
|
|
368 | (1) |
|
|
|
368 | (1) |
|
Compile-Time Rational Arithmetic |
|
|
369 | (1) |
|
|
|
369 | (1) |
|
|
|
369 | (1) |
|
The Standard Template Library |
|
|
369 | (7) |
|
|
|
376 | (8) |
|
What's Missing from the STL |
|
|
384 | (1) |
|
|
|
384 | (1) |
|
Chapter 12 Understanding Containers And Iterators |
|
|
385 | (72) |
|
|
|
386 | (7) |
|
|
|
387 | (1) |
|
Exceptions and Error Checking |
|
|
388 | (1) |
|
|
|
388 | (3) |
|
|
|
391 | (2) |
|
|
|
393 | (28) |
|
|
|
393 | (19) |
|
The vector <bool> Specialization |
|
|
412 | (1) |
|
|
|
413 | (1) |
|
|
|
413 | (5) |
|
|
|
418 | (1) |
|
|
|
418 | (3) |
|
|
|
421 | (7) |
|
|
|
421 | (3) |
|
|
|
424 | (3) |
|
|
|
427 | (1) |
|
|
|
428 | (16) |
|
|
|
428 | (2) |
|
|
|
430 | (8) |
|
|
|
438 | (3) |
|
|
|
441 | (3) |
|
|
|
444 | (1) |
|
Unordered Associative Containers/Hash Tables |
|
|
444 | (6) |
|
|
|
444 | (1) |
|
|
|
445 | (3) |
|
unordered_map Example: Phone Book |
|
|
448 | (1) |
|
|
|
449 | (1) |
|
unordered_set/unordered_multiset |
|
|
449 | (1) |
|
|
|
450 | (6) |
|
|
|
450 | (1) |
|
|
|
451 | (1) |
|
|
|
451 | (1) |
|
|
|
452 | (4) |
|
|
|
456 | (1) |
|
Chapter 13 Mastering STL Algorithms |
|
|
457 | (52) |
|
|
|
457 | (6) |
|
The find and find_if Algorithms |
|
|
458 | (3) |
|
The accumulate Algorithms |
|
|
461 | (1) |
|
C++11 Move Semantics with Algorithms |
|
|
462 | (1) |
|
|
|
463 | (6) |
|
|
|
463 | (2) |
|
|
|
465 | (1) |
|
Lambda Expressions as Return Type |
|
|
465 | (2) |
|
Lambda Expressions as Parameters |
|
|
467 | (1) |
|
|
|
467 | (2) |
|
|
|
469 | (12) |
|
Arithmetic Function Objects |
|
|
470 | (1) |
|
Comparison Function Objects |
|
|
471 | (1) |
|
|
|
472 | (1) |
|
|
|
473 | (1) |
|
|
|
473 | (7) |
|
Writing Your Own Function Objects |
|
|
480 | (1) |
|
|
|
481 | (22) |
|
|
|
482 | (1) |
|
|
|
483 | (7) |
|
|
|
490 | (9) |
|
|
|
499 | (2) |
|
|
|
501 | (2) |
|
Algorithms Example: Auditing Voter Registrations |
|
|
503 | (4) |
|
The Voter Registration Audit Problem Statement |
|
|
503 | (1) |
|
The auditVoterRolls Function |
|
|
504 | (1) |
|
The getDuplicates Function |
|
|
505 | (1) |
|
Testing the auditVoterRolls Function |
|
|
506 | (1) |
|
|
|
507 | (2) |
|
Chapter 14 Using Strings And Regular Expressions |
|
|
509 | (36) |
|
|
|
510 | (7) |
|
|
|
510 | (2) |
|
|
|
512 | (1) |
|
|
|
513 | (3) |
|
|
|
516 | (1) |
|
|
|
517 | (6) |
|
Localizing String Literals |
|
|
518 | (1) |
|
|
|
518 | (1) |
|
Non-Western Character Sets |
|
|
519 | (2) |
|
|
|
521 | (2) |
|
|
|
523 | (20) |
|
|
|
524 | (6) |
|
|
|
530 | (1) |
|
|
|
531 | (3) |
|
|
|
534 | (2) |
|
|
|
536 | (1) |
|
|
|
537 | (3) |
|
|
|
540 | (3) |
|
|
|
543 | (2) |
|
Chapter 15 Demystifying C++ I/O |
|
|
545 | (24) |
|
|
|
546 | (14) |
|
What Is a Stream, Anyway? |
|
|
546 | (1) |
|
Stream Sources and Destinations |
|
|
547 | (1) |
|
|
|
547 | (5) |
|
|
|
552 | (7) |
|
Input and Output with Objects |
|
|
559 | (1) |
|
|
|
560 | (2) |
|
|
|
562 | (4) |
|
Jumping around with seek() and tell() |
|
|
563 | (2) |
|
|
|
565 | (1) |
|
|
|
566 | (1) |
|
|
|
567 | (2) |
|
Chapter 16 Additional Library Utilities |
|
|
569 | (26) |
|
|
|
569 | (2) |
|
|
|
571 | (3) |
|
|
|
574 | (7) |
|
|
|
574 | (4) |
|
|
|
578 | (2) |
|
|
|
580 | (1) |
|
|
|
581 | (9) |
|
|
|
582 | (2) |
|
Random Number Engine Adapters |
|
|
584 | (1) |
|
Predefined Engines and Engine Adapters |
|
|
584 | (1) |
|
Generating Random Numbers |
|
|
585 | (2) |
|
Random Number Distributions |
|
|
587 | (3) |
|
|
|
590 | (4) |
|
|
|
594 | (1) |
|
Chapter 17 Customizing And Extending The STL |
|
|
595 | (50) |
|
|
|
596 | (1) |
|
|
|
596 | (6) |
|
|
|
596 | (2) |
|
|
|
598 | (1) |
|
|
|
599 | (1) |
|
|
|
600 | (2) |
|
|
|
602 | (39) |
|
|
|
602 | (1) |
|
|
|
602 | (3) |
|
|
|
605 | (36) |
|
|
|
641 | (4) |
| Part III: Mastering Advanced Features of C++ |
|
|
Chapter 18 Overloading C++ Operators |
|
|
645 | (38) |
|
Overview of Operator Overloading |
|
|
646 | (8) |
|
|
|
646 | (1) |
|
Limitations to Operator Overloading |
|
|
646 | (1) |
|
Choices in Operator Overloading |
|
|
647 | (2) |
|
Operators You Shouldn't Overload |
|
|
649 | (1) |
|
Summary of Overloadable Operators |
|
|
650 | (3) |
|
|
|
653 | (1) |
|
Overloading the Arithmetic Operators |
|
|
654 | (2) |
|
Overloading Unary Minus and Unary Plus |
|
|
654 | (1) |
|
Overloading Increment and Decrement |
|
|
655 | (1) |
|
Overloading the Bitwise and Binary Logical Operators |
|
|
656 | (1) |
|
Overloading the Insertion and Extraction Operators |
|
|
657 | (2) |
|
Overloading the Subscripting Operator |
|
|
659 | (5) |
|
Providing Read-Only Access with operator[ ] |
|
|
662 | (1) |
|
Non-Integral Array Indices |
|
|
663 | (1) |
|
Overloading the Function Call Operator |
|
|
664 | (2) |
|
Overloading the Dereferencing Operators |
|
|
666 | (3) |
|
|
|
667 | (1) |
|
|
|
668 | (1) |
|
What in the World Is operator ->*? |
|
|
669 | (1) |
|
Writing Conversion Operators |
|
|
669 | (6) |
|
Ambiguity Problems with Conversion Operators |
|
|
671 | (1) |
|
Conversions for Boolean Expressions |
|
|
672 | (3) |
|
Overloading the Memory Allocation and Deallocation Operators |
|
|
675 | (7) |
|
How new and delete Really Work |
|
|
675 | (2) |
|
Overloading operator new and operator delete |
|
|
677 | (2) |
|
Overloading operator new and operator delete with Extra Parameters |
|
|
679 | (2) |
|
Explicitly Deleting/Defaulting operator new and operator delete |
|
|
681 | (1) |
|
|
|
682 | (1) |
|
Chapter 19 Writing Generic Code With Templates |
|
|
683 | (32) |
|
|
|
684 | (1) |
|
|
|
684 | (26) |
|
|
|
685 | (8) |
|
How the Compiler Processes Templates |
|
|
693 | (1) |
|
Distributing Template Code between Files |
|
|
694 | (1) |
|
|
|
695 | (3) |
|
|
|
698 | (5) |
|
Template Class Specialization |
|
|
703 | (3) |
|
Subclassing Template Classes |
|
|
706 | (2) |
|
Inheritance versus Specialization |
|
|
708 | (1) |
|
|
|
708 | (1) |
|
Alternative Function Syntax |
|
|
709 | (1) |
|
|
|
710 | (4) |
|
Function Template Specialization |
|
|
711 | (1) |
|
Function Template Overloading |
|
|
712 | (1) |
|
Friend Function Templates of Class Templates |
|
|
713 | (1) |
|
|
|
714 | (1) |
|
Chapter 20 Advanced Templates |
|
|
715 | (44) |
|
More about Template Parameters |
|
|
715 | (9) |
|
More about Template Type Parameters |
|
|
715 | (4) |
|
Introducing Template Template Parameters |
|
|
719 | (2) |
|
More about Non-Type Template Parameters |
|
|
721 | (3) |
|
Template Class Partial Specialization |
|
|
724 | (5) |
|
Another Form of Partial Specialization |
|
|
726 | (3) |
|
Emulating Function Partial Specialization with Overloading |
|
|
729 | (2) |
|
|
|
730 | (1) |
|
|
|
731 | (7) |
|
An N-Dimensional Grid: First Attempt |
|
|
731 | (2) |
|
A Real N-Dimensional Grid |
|
|
733 | (5) |
|
|
|
738 | (4) |
|
|
|
738 | (1) |
|
|
|
739 | (1) |
|
auto and decltype with Templates |
|
|
739 | (3) |
|
|
|
742 | (4) |
|
Type-Safe Variable-Length Argument Lists |
|
|
743 | (2) |
|
Variable Number of Mix-In Classes |
|
|
745 | (1) |
|
|
|
746 | (11) |
|
Factorial at Compile Time |
|
|
746 | (1) |
|
|
|
747 | (2) |
|
|
|
749 | (2) |
|
|
|
751 | (6) |
|
|
|
757 | (1) |
|
|
|
757 | (2) |
|
Chapter 21 Effective Memory Management |
|
|
759 | (38) |
|
Working with Dynamic Memory |
|
|
759 | (12) |
|
|
|
760 | (1) |
|
Allocation and Deallocation |
|
|
761 | (2) |
|
|
|
763 | (6) |
|
|
|
769 | (2) |
|
|
|
771 | (3) |
|
|
|
772 | (1) |
|
Not All Pointers Are Arrays! |
|
|
773 | (1) |
|
Low-Level Memory Operations |
|
|
774 | (5) |
|
|
|
774 | (1) |
|
|
|
775 | (1) |
|
|
|
775 | (1) |
|
|
|
776 | (1) |
|
|
|
776 | (2) |
|
Pointers to Methods and Members |
|
|
778 | (1) |
|
|
|
779 | (11) |
|
The Old Deprecated auto_ptr |
|
|
780 | (1) |
|
The New C++11 Smart Pointers |
|
|
781 | (3) |
|
Writing Your Own Smart Pointer Class |
|
|
784 | (6) |
|
|
|
790 | (6) |
|
|
|
790 | (1) |
|
|
|
791 | (3) |
|
Double-Deleting and Invalid Pointers |
|
|
794 | (1) |
|
Accessing Out-of-Bounds Memory |
|
|
795 | (1) |
|
|
|
796 | (1) |
|
Chapter 22 Multithreaded Programming With C++ |
|
|
797 | (42) |
|
|
|
798 | (4) |
|
Race Conditions and Deadlocks |
|
|
799 | (3) |
|
Atomic Operations Library |
|
|
802 | (4) |
|
|
|
803 | (2) |
|
|
|
805 | (1) |
|
|
|
806 | (9) |
|
Thread with Function Pointer |
|
|
806 | (2) |
|
Thread with Function Object |
|
|
808 | (2) |
|
|
|
810 | (1) |
|
Thread with Member Function |
|
|
811 | (1) |
|
|
|
811 | (1) |
|
|
|
812 | (1) |
|
Retrieving Results from Threads |
|
|
812 | (1) |
|
Copying and Rethrowing Exceptions |
|
|
812 | (3) |
|
|
|
815 | (8) |
|
|
|
815 | (2) |
|
|
|
817 | (2) |
|
|
|
819 | (1) |
|
|
|
820 | (3) |
|
|
|
823 | (2) |
|
|
|
825 | (2) |
|
Example: Multithreaded Logger Class |
|
|
827 | (6) |
|
|
|
833 | (1) |
|
Threading Design and Best Practices |
|
|
834 | (1) |
|
|
|
835 | (4) |
| Part IV: C++ Software Engineering |
|
|
Chapter 23 Maximizing Software Engineering Methods |
|
|
839 | (20) |
|
|
|
840 | (1) |
|
Software Life Cycle Models |
|
|
841 | (6) |
|
The Stagewise Model and Waterfall Model |
|
|
841 | (2) |
|
|
|
843 | (2) |
|
The Rational Unified Process |
|
|
845 | (2) |
|
Software Engineering Methodologies |
|
|
847 | (7) |
|
|
|
847 | (1) |
|
|
|
848 | (2) |
|
|
|
850 | (4) |
|
|
|
854 | (1) |
|
Building Your Own Process and Methodology |
|
|
854 | (1) |
|
|
|
854 | (1) |
|
Bring New Ideas to the Table |
|
|
855 | (1) |
|
Recognize What Works and What Doesn't Work |
|
|
855 | (1) |
|
|
|
855 | (1) |
|
|
|
855 | (2) |
|
|
|
857 | (2) |
|
Chapter 24 Writing Efficient C++ |
|
|
859 | (24) |
|
Overview of Performance and Efficiency |
|
|
859 | (2) |
|
Two Approaches to Efficiency |
|
|
860 | (1) |
|
|
|
860 | (1) |
|
Is C++ an Inefficient Language? |
|
|
860 | (1) |
|
Language-Level Efficiency |
|
|
861 | (5) |
|
Handle Objects Efficiently |
|
|
862 | (4) |
|
Use Inline Methods and Functions |
|
|
866 | (1) |
|
|
|
866 | (5) |
|
Cache as Much as Possible |
|
|
866 | (1) |
|
|
|
867 | (4) |
|
|
|
871 | (11) |
|
Profiling Example with gprof |
|
|
872 | (8) |
|
Profiling Example with Visual C++ 2010 |
|
|
880 | (2) |
|
|
|
882 | (1) |
|
Chapter 25 Developing Cross-Platform And Cross-Language Applications |
|
|
883 | (22) |
|
Cross-Platform Development |
|
|
884 | (4) |
|
|
|
884 | (2) |
|
|
|
886 | (2) |
|
Platform-Specific Features |
|
|
888 | (1) |
|
Cross-Language Development |
|
|
888 | (15) |
|
|
|
889 | (1) |
|
|
|
889 | (3) |
|
|
|
892 | (2) |
|
|
|
894 | (2) |
|
Mixing Java and C++ with JNI |
|
|
896 | (2) |
|
Mixing C++ with Perl and Shell Scripts |
|
|
898 | (4) |
|
Mixing C++ with Assembly Code |
|
|
902 | (1) |
|
|
|
903 | (2) |
|
Chapter 26 Becoming Adept At Testing |
|
|
905 | (22) |
|
|
|
906 | (3) |
|
Whose Responsibility Is Testing? |
|
|
906 | (1) |
|
|
|
906 | (1) |
|
|
|
907 | (2) |
|
|
|
909 | (12) |
|
Approaches to Unit Testing |
|
|
909 | (1) |
|
|
|
910 | (4) |
|
|
|
914 | (7) |
|
|
|
921 | (3) |
|
|
|
921 | (2) |
|
|
|
923 | (1) |
|
|
|
923 | (1) |
|
Tips for Successful Testing |
|
|
924 | (1) |
|
|
|
925 | (2) |
|
Chapter 27 Conquering Debugging |
|
|
927 | (40) |
|
The Fundamental Law of Debugging |
|
|
928 | (1) |
|
|
|
928 | (1) |
|
|
|
928 | (1) |
|
|
|
929 | (16) |
|
|
|
929 | (1) |
|
|
|
930 | (13) |
|
|
|
943 | (1) |
|
|
|
944 | (1) |
|
|
|
945 | (21) |
|
|
|
945 | (1) |
|
Debugging Reproducible Bugs |
|
|
946 | (1) |
|
Debugging Non reproducible Bugs |
|
|
947 | (1) |
|
Debugging Memory Problems |
|
|
948 | (4) |
|
Debugging Multithreaded Programs |
|
|
952 | (1) |
|
Debugging Example: Article Citations |
|
|
953 | (13) |
|
Lessons from the Article Citations Example |
|
|
966 | (1) |
|
|
|
966 | (1) |
|
Chapter 28 Incorporating Design Techniques And Frameworks |
|
|
967 | (18) |
|
"I Can Never Remember How to..." |
|
|
968 | (5) |
|
|
|
968 | (1) |
|
... Subclass an Existing Class |
|
|
969 | (1) |
|
... Throw and Catch Exceptions |
|
|
970 | (1) |
|
|
|
971 | (1) |
|
|
|
971 | (1) |
|
... Write a Template Class |
|
|
972 | (1) |
|
There Must Be a Better Way |
|
|
973 | (8) |
|
|
|
973 | (6) |
|
|
|
979 | (2) |
|
Object-Oriented Frameworks |
|
|
981 | (2) |
|
|
|
982 | (1) |
|
The Model-View-Controller Paradigm |
|
|
982 | (1) |
|
|
|
983 | (2) |
|
Chapter 29 Applying Design Patterns |
|
|
985 | (28) |
|
|
|
986 | (1) |
|
|
|
987 | (8) |
|
Example: A Logging Mechanism |
|
|
987 | (1) |
|
Implementation of a Singleton |
|
|
987 | (4) |
|
|
|
991 | (1) |
|
Singletons and Multithreading |
|
|
992 | (3) |
|
|
|
995 | (5) |
|
Example: A Car Factory Simulation |
|
|
995 | (1) |
|
Implementation of a Factory |
|
|
996 | (2) |
|
|
|
998 | (2) |
|
|
|
1000 | (1) |
|
|
|
1000 | (2) |
|
Example: Hiding Network Connectivity Issues |
|
|
1000 | (1) |
|
Implementation of a Proxy |
|
|
1001 | (1) |
|
|
|
1002 | (1) |
|
|
|
1002 | (2) |
|
Example: Adapting a Logger Class |
|
|
1002 | (1) |
|
Implementation of an Adapter |
|
|
1003 | (1) |
|
|
|
1004 | (1) |
|
|
|
1004 | (3) |
|
Example: Defining Styles in Web Pages |
|
|
1004 | (1) |
|
Implementation of a Decorator |
|
|
1005 | (1) |
|
|
|
1006 | (1) |
|
The Chain of Responsibility Pattern |
|
|
1007 | (2) |
|
|
|
1008 | (1) |
|
Implementation of a Chain of Responsibility |
|
|
1008 | (1) |
|
Using a Chain of Responsibility |
|
|
1009 | (1) |
|
|
|
1009 | (3) |
|
|
|
1009 | (1) |
|
Implementation of an Observer |
|
|
1009 | (2) |
|
|
|
1011 | (1) |
|
|
|
1012 | (1) |
| Appendix A: C++ Interviews |
|
1013 | (22) |
| Appendix B: Annotated Bibliography |
|
1035 | (10) |
| Appendix C: Standard Library Header Files |
|
1045 | (8) |
| Index |
|
1053 | |