3594089
9780805316773
Preface. Prelude. First Try. Doing it without Classes. Why was it Easier in C++? A Bigger Example. Conclusion. I. MOTIVATION. 1. Why I Use C++. The Problem. History and Context. Automatic Software Distribution. Enter C++. Recycled Software. Postscript. 2. Why I Work on C++. The Success of Small Projects. Abstraction. Machines Should Work for People. 3. Living in the Real World. II. CLASSES aND INHERITANCE. 4. Checklist for Class Authors. 5. Surrogate Classes. The Problem. The Classical Solution. Virtual Copy Functions. Defining a Surrogate Class. Summary. 6. Handles: Part 1. The Problem. A Simple Class. Attaching a Handle. Getting at the Object. Simple Implementation. Use-Counted Handles. Copy on Write. Discussion. 7. Handles: Part 2. Review. Separating the use Count. Abstraction of use Counts. Access Functions and Copy on Write. Discussion. 8. An Object-Oriented Program. The Problem. An Object-Oriented Solution. Handle Classes. Extension 1: New Operations. Extension 2: New Node Types. Reflections. 9. Analysis of a Classroom Exercise: Part 1. The Problem. Designing the Interface. A Few Loose Ends. Testing the Interface. Strategy. Tactics. Combining Pictures. Conclusion. 10. Analysis of a Classroom Exercise: Part 2. Strategy. Exploiting the Structure. Conclusion. 11. When not to use Virtual Functions. The Case For. The Case Against. Destructors are Special. Summary. III. TEMPLATES. 12. Designing a Container Class. What Does it Contain? What Does Copying the Container Mean? How Do You Get at Container Elements? How Do You Distinguish Reading from Writing? How Do You Handle Container Growth? What Operations Does the Container Provide? What Do You Assume about the Container Element Type? Containers and Inheritance. Designing an Arraylike Class. 13. Accessing Container Elements. Imitating a Pointer. Getting at the Data. Remaining Problems. Pointer to Const Array. Useful Additions. 14. Iterators. Completing the Pointer Class. What is an Iterator? Deleting an Element. Deleting the Container. Other Design Considerations. Discussion. 15. Sequences. The State of the Art. A Radical Old Idea. Well, Maybe a Few Extras. Example of Use. Maybe a Few More. Food for Thought. 16. Templates as Interfaces. The Problem. The First Example. Separating the Iteration. Iterating Over Arbitrary Types. Adding Other Types. Abstracting the Storage Technique. The Proof of the Pudding. Summary. 17. Templates and Generic Algorithms. A Specific Example. Generalizing the Element Type. Postponing the Count. Address Independence. SearcKelley, Al is the author of 'Book on C:programming in C' with ISBN 9780805316773 and ISBN 0805316779.
[read more]