search for books and compare prices
Tables of Contents for Modern C++ Design
Chapter/Section Title
Page #
Page Count
Foreword
xi
 
Scott Meyers
Foreword
xv
 
John Vlissides
Preface
xvii
 
Acknowledgments
xxi
 
Part I Techniques
1
96
Policy-Based Class Design
3
20
The Multiplicity of Software Design
3
1
The Failure of the Do-It-All Interface
4
1
Multiple Inheritance to the Rescue?
5
1
Templates Bring Hope
6
1
Policies and Policy Classes
7
5
Enriched Policies
12
1
Destructors of Policy Classes
12
1
Optional Functionality Through Incomplete Instantiation
13
1
Combining Policy Classes
14
2
Customizing Structure with Policy Classes
16
1
Compatabile and Noncompatible Policies
17
2
Decomposing a Class in Policies
19
1
Summary
20
3
Techniques
23
26
Compile-Time Assertions
23
3
Partial Template Specialization
26
2
Local Classes
28
1
Mapping Integral Constants to Types
29
2
Type-to-Type Mapping
31
2
Type Selection
33
1
Detecting Convertibility and Inheritance at Compile Time
34
3
A Wrapper Around type_info
37
2
NullType and EmptyType
39
1
Type Traits
40
6
Summary
46
3
Typelists
49
28
The Need for Typelists
49
2
Defining Typelists
51
1
Linearizing Typelist Creation
52
1
Calculating Length
53
1
Intermezzo
54
1
Indexed Access
55
1
Searching Typelists
56
1
Appending to Typelists
57
1
Erasing a Type from a Typelist
58
1
Erasing Duplicates
59
1
Replacing an Element in a Typelist
60
1
Partially Ordering Typelists
61
3
Class Generation with Typelists
64
10
Summary
74
1
Typelist Quick Facts
75
2
Small-Object Allocation
77
20
The Default Free Store Allocator
78
1
The Workings of a Memory Allocator
78
2
A Small-Object Allocator
80
1
Chunks
81
3
The Fixed-Size Allocator
84
3
The Small ObjAllocator Class
87
2
A Hat Trick
89
3
Simple, Complicated, Yet Simple in the End
92
1
Administrivia
93
1
Summary
94
1
SmallObjectAllocator Quick Facts
94
3
Part II Components
97
204
Generalized Functors
99
30
The Command Design Pattern
100
2
Command in the Real World
102
1
C++ Callable Entities
103
1
The Functor Class Template Skeleton
104
4
Implementing the Forwarding Functor::operator ()
108
2
Handling Functors
110
2
Build One, Get One Free
112
2
Argument and Return Type Conversions
114
1
Handling Pointers to Member Functions
115
4
Binding
119
3
Chaining Requests
122
1
Real-World Issues I: The Cost of Forwarding Functions
122
2
Real-World Issues II: Heap Allocation
124
1
Implementing Undo and Redo with Functor
125
1
Summary
126
1
Functor Quick Facts
126
3
Implementing Singletons
129
28
Static Data + Static Functions != Singleton
130
1
The Basic C++ Idioms Supporting Singleton
131
1
Enforcing the Singleton's Uniqueness
132
1
Destroying the Singleton
133
2
The Dead Reference Problem
135
2
Addressing the Dead Reference Problem (I): The Phoenix Singleton
137
2
Addressing the Dead Reference Problem (II): Singletons with Longevity
139
3
Implementing Singletons with Longevity
142
3
Living in a Multithreaded World
145
3
Putting It All Together
148
5
Working With SingletonHolder
153
2
Summary
155
1
SingletonHolder Class Template Quick Facts
155
2
Smart Pointers
157
40
Smart Pointers 101
157
1
The Deal
158
2
Smart Pointers' Storage
160
1
Smart Pointer Member Functions
161
2
Ownership-Handling Strategies
163
7
The Address-of Operator
170
1
Implicit Conversion of Raw Pointer Type
171
2
Equality and Inequality
173
5
Ordering Comparisons
178
3
Checking and Error Reporting
181
1
Smart Pointers to const and const Smart Pointers
182
1
Arrays
183
1
Smart Pointers and Multithreading
184
3
Putting It All Together
187
7
Summary
194
1
SmartPtr Quick Facts
194
3
Object Factories
197
22
The Need for Object Factories
198
2
Object Factories in C++: Classes and Objects
200
1
Implementing an Object Factory
201
5
Type Identifiers
206
1
Generalization
207
3
Minutiae
210
1
Clone Factories
211
4
Using Object Factories with Other Generic Components
215
1
Summary
216
1
Factory Class Template Quick Facts
216
1
CloneFactory Class Template Quick Facts
217
2
Abstract Factory
219
16
The Architectural Role of Abstract Factory
219
4
A Generic Abstract Factory Interface
223
3
Implementing AbstractFactory
226
2
A Prototype-Based Abstract Factory Implementation
228
5
Summary
233
1
AbstractFactory and ConcreteFactory Quick Facts
233
2
Visitor
235
28
Visitor Basics
235
7
Overloading: The Catch-All Function
242
1
An Implementation Refinement: The Acyclic Visitor
243
5
A Generic Implementation of Visitor
248
7
Back to the ``Cyclic'' Visitor
255
3
Hooking Variations
258
2
Summary
260
1
Visitor Generic Component Quick Facts
261
2
Multimethods
263
38
What Are Multimethods?
264
1
When Are Multimethods Needed?
264
1
Double Switch-on-Type: Brute Force
265
3
The Brute-Force Approach Automated
268
5
Symmetry with the Brute-Force Dispatcher
273
3
The Logarithmic Double Dispatcher
276
6
FnDispatcher and Symmetry
282
1
Double Dispatch to Functors
282
3
Converting Arguments: static_cast or dynamic_cast?
285
5
Constant-Time Multimethods: Raw Speed
290
3
BasicDispatcher and BasicFastDispatcher as Policies
293
1
Looking Forward
294
2
Summary
296
1
Double Dispatcher Quick Facts
297
4
Appendix A Minimalist Multithreading Library
301
10
A.1 A Critique of Multithreading
302
1
A.2 Loki's Approach
303
1
A.3 Atomic Operations on Integral Types
303
2
A.4 Mutexes
305
1
A.5 Locking Semantics in Object-Oriented Programming
306
2
A.6 Optional volatile Modifier
308
1
A.7 Semaphores, Events, and Other Good Things
309
1
A.8 Summary
309
2
Bibliography
311
2
Index
313