C++ In Action: Industrial Strength Programming Techniques

B. Milewski · 2001

(NOTE: Most chapters include a Summary and Conclusion, and Exercises.) Preface. Why This Book? Why You? Why Me? Acknowledgment. Introduction. Language. Techniques. Windows. Scaling Up. How to Use This Book. Version Control System. Compiler. Code Samples. Typeface Conventions. I. LANGUAGE. 1. Objects and Scopes. Global Scope. Local Scope. Embedded objects. Inheritance. Member Functions and Interfaces. Member Function Scope. Types. Abstract Data Types. 2. Arrays and References. References. Operators. Arithmetic. Logic. Bitwise Logic. Stack-Based Calculator. External Specification. Design. Stubbed Implementation. Implementation. Calculator: Implementation. Input: Implementation. 3. Pointers. Evils of Pointers. Pointers versus References. Pointers versus Arrays. Assembly Digression. Pointers and Dynamic Memory Allocation. Dynamic Data Structures. Dynamic Stack. Linked List. String Table. String Buffer. Table Lookup. Hash Table. Test Program. 4. Polymorphism. The Meaning of is-a. Implementation Digression. The Overhead. Parse Tree. C Digression. 5. A Small Software Project. Starting a Software Project. Design Specification. Stubbed Implementation. Expanding Stubs. Final Implementation. Not! Scanner. Symbol Table. Store. Function Table. Nodes. Parser. Main. Initialization of Aggregates. Procedural Programming. Operator Overloading. Passing by Value. Value Semantics. II. TECHNIQUES. 6. The Cleanup. Decoupling the Output. Fighting Defensive Programming. A Case of Paranoid Programming. Fringes. Improving Communication between Classes. Correcting Design Flaws. 7. Hiding Implementation Details. Using Embedded Classes. Combining Classes. Combining Things Using Namespaces. Hiding Constants in Enumerations. Hiding Constants in Local Variables. 8. Sharing. Isolating Global Program Parameters. Pushing the Envelope. Templates. 9. Removing Limitations. Dynamic Array. Dynamic MultiNode. Dynamic StringBuffer. Dynamic SymbolTable. Dynamic Store. Standard Vector. 10. Resource Management. Exceptions. Stack Unwinding. Resources. Ownership of Resources. Access to Resources. Smart Pointers. Ownership Transfer: First Attempt. Ownership Transfer: Second Attempt. Safe Containers. Iterators. Error Propagation. Conversion to Resource Management. Conclusion. 11. Using the Standard Template Library. Reference Counting and Copy-On-Write. End of Restrictions. Getting Rid of C-String. Exploring Streams. 12. Persistence. The Calculator Object. Command Parser. Serialization and Deserialization. In-Memory Serialization and Deserialization. Multiple Inheritance. 13. Overloading Operator new. Class-Specific new. Caching. Bulk Allocation. Array new. Global new. Macros. Tracing Memory Leaks. Debug Output. Placement new. Conclusion. III. WINDOWS. 14. Libraries. Of Macros and Wizards. 15. Programming Paradigm. Hello Windows! Encapsulation. 16. Controlling Windows through C11. Model-View-Controller. Controller. Client Code. Exception Specification. Cleanup. 17. Painting. Application Icon. Window Painting and the View Object. The Canvas. The WM_PAINT Message. The Model. Capturing the Mouse. Adding Colors and Frills. 18. A Windows Application. Porting the Calculator to Windows. User Interface. Child Windows. Windows Controls. Static Text. Edit Control. Window Subclassing. Plugging in the Calculator. List Box Control. Model-View Feedback Loop. Commands and Menus. Dynamic Menus. Dialog Boxes. IV. SCALING UP. 19. About Software. Complexity. The Fractal Nature of Software. The Living Project. The Living Programmer. 20. Design Strategies. Top-Down Object-Oriented Design. User Interface. Requirement Specification. Architectural Specification. 21. Team Work. Productivity. Team Strategies. 22. Implementation Strategies. Global Decisions. Top-Down Object-Oriented Implementation. Program Modifications. Inheriting Legacy Code. Multi-Platform Development. 23. Porting. Creating an Abstraction Layer. Porting the Calculator. Eliminating Simple Windows Dependencies. Nontrivial Windows Dependencies. The Advantages of Porting. Bibliography. Appendix A: Exercise Solutions. Appendix B: Transactions. Transient Transactions. Persistent Transactions. The Three-File Scheme. The Mapping-File Scheme. Index. 0201699486T05212002

Read the paper · More papers on PaperTik