C++设计新思维 影印本PDF电子书下载
- 电子书积分:12 积分如何计算积分?
- 作 者:(美)亚力山德雷斯库著
- 出 版 社:北京:中国电力出版社
- 出版年份:2003
- ISBN:7508314964
- 页数:323 页
PartⅠ Techniques 1
Chapter 1 Policy-Based Class Design 3
1.1 The Multiplicity of Software Design 3
1.2 The Failure of the Do-It-All Interface 4
1.3 Multiple Inheritance to the Rescue? 5
1.4 The Benefit of Templates 6
1.5 Policies and Policy Classes 7
1.7 Destructors of Policy Classes 12
1.6 Enriched Policies 12
1.8 Optional Functionality Through Incomplete Instantiation 13
1.9 Combining Policy Classes 14
1.10 Customizing Structure with Policy Classes 16
1.11 Compatible and Incompatible Policies 17
1.12 Decomposing a Class into Policies 19
1.13 Summary 20
Chapter 2 Techniques 23
2.1 Compile-Time Assertions 23
2.2 Partial Template Specialization 26
2.3 Local Classes 28
2.4 Mapping Integral Constants to Types 29
2.5 Type-to-Type Mapping 31
2.6 Type Selection 33
2.7 Detecting Convertibility and Inheritance at Compile Time 34
2.8 A Wrapper Around type_info 37
2.9 NullType and EmptyType 39
2.10 Type Traits 40
2.11 Summary 46
3.1 The Need for Typelists 49
Chapter 3 Typelists 49
3.2 Defining Typelists 51
3.3 Linearizing Typelist Creation 52
3.4 Calculating Length 53
3.5 Intermezzo 54
3.6 Indexed Access 55
3.7 Searching Typelists 56
3.8 Appending to Typelists 57
3.9 Erasing a Type from a Typelist 58
3.10 Erasing Duplicates 59
3.11 Replacing an Element in a Typelist 60
3.12 Partially Ordering Typelists 61
3.13 Class Generation with Typelists 64
3.14 Summary 74
3.15 Typelist Quick Facts 75
Chapter 4 Small-Object Allocation 77
4.1 The Default Free Store Allocator 78
4.2 The Workings of a Memory Allocator 78
4.3 A Small-Object Allocator 80
4.4 Chunks 81
4.5 The Fixed-Size Allocator 84
4.6 The SmallObjAllocator Class 87
4.7 A Hat Trick 89
4.8 Simple,Complicated,Yet Simple in the End 92
4.9 Administrivia 93
4.10 Summary 94
4.11 Small-Object Allocator Quick Facts 94
Part Ⅱ Components 97
Chapter 5 Generalized Functors 99
5.1 The Command Design Pattern 100
5.2 Command in the Real World 102
5.3 C++ Callable Entities 103
5.4 The Functor Class Template Skeleton 104
5.5 Implementing the Forwarding Functor::operator() 108
5.6 Handling Functors 110
5.7 Build One,Get One Free 112
5.8 Argument and Return Type Conversions 114
5.9 Handling Pointers to Member Functions 115
5.10 Binding 119
5.12 Real-World IssuesⅠ:The Cost of Forwarding Functions 122
5.11 Chaining Requests 122
5.13 Real-World IssuesⅡ:Heap Allocation 124
5.14 Implementing Undo and Redo with Functor 125
5.15 Summary 126
5.16 Functor Quick Facts 126
Chapter 6 Implementing Singletons 129
6.1 Static Data + Static Functions!=Singleton 130
6.2 The Basic C++ Idioms Supporting Singleton 131
6.3 Enforcing the Singleton s Uniqueness 132
6.4 Destroying the Singleton 133
6.5 The Dead Reference Problem 135
6.6 Addressing the Dead Reference Problem(Ⅰ):The Phoenix Singleton 137
6.7 Addressing the Dead Reference Problem(Ⅱ):Singletons with Longevity 139
6.8 Implementing Singletons with Longevity 142
6.9 Living in a Multithreaded World 145
6.10 Putting It All Together 148
6.11 Working with SingletonHolder 153
6.12 Summary 155
6.13 SingletonHo1der Class Template Quick Facts 155
7.1 Smart Pointers 101 157
Chapter 7 Smart Pointers 157
7.2 The Deal 158
7.3 Storage of Smart Pointers 160
7.4 Smart Pointer Member Functions 161
7.5 Ownership-Handling Strategies 163
7.6 The Address-of Operator 170
7.7 Implicit Conversion to Raw Pointer Types 171
7.8 Equality and Inequality 173
7.9 Ordering Comparisons 178
7.10 Checking and Error Reporting 181
7.11 Smart Pointers to const and const Smart Pointers 182
7.12 Arrays 183
7.13 Smart Pointers and Multithreading 184
7.14 Putting It All Together 187
7.15 Summary 194
7.16 SmartPtr Quick Facts 194
Chapter 8 Object Factories 197
8.1 The Need for Object Factories 198
8.2 Object Factories in C++:Classes and Objects 200
8.3 Implementing an Object Factory 201
8.4 Type Identifiers 206
8.5 Generalization 207
8.6 Minutiae 210
8.7 Clone Factories 211
8.8 Using Object Factories with Other Generic Components 215
8.9 Summary 216
8.10 Factory Class Template Quick Facts 216
8.11 CloneFactory Class Template Quick Facts 217
Chapter 9 Abstract Factory 219
9.1 The Architectural Role of Abstract Factory 219
9.2 A Generic Abstract Factory Interface 223
9.3 Implementing AbstractFactory 226
9.4 A Prototype-Based Abstract Factory Implementation 228
9.5 Summary 233
9.6 AbstractFactory and ConcreteFactory Quick Facts 233
Chapter 10 Visitor 235
10.1 Visitor Basics 235
10.2 Overloading and the Catch-All Function 242
10.3 An Implementation Refinement: The Acyclic Visitor 243
10.4 A Generic Implementation of Visitor 248
10.5 Back to the Cyclic Visitor 255
10.6 Hooking Variations 258
10.7 Summary 260
10.8 Visitor Generic Component Quick Facts 261
Chapter 11 Multimethods 263
11.1 What Are Multimethods? 264
11.2 When Are Multimethods Needed? 264
11.3 Double Switch-on-Type:Brute Force 265
11.4 The Brute-Force Approach Automated 268
11.5 Symmetry with the Brute-Force Dispatcher 273
11.6 The Logarithmic Double Dispatcher 276
11.7 FnDispatcher and Symmetry 282
11.8 Double Dispatch to Functors 282
11.9 Converting Arguments:static_cast or dynamic_cast? 285
11.10 Constant-Time Multimethods:Raw Speed 290
11.11 BasicDispatcher and BasicFastDispatcher as Policies 293
11.12 Looking Forward 294
11.13 Summary 296
11.14 Double Dispatcher Quick Facts 297
Appendix A Minimalist Multithreading Library 301
A.1 A Critique of Multithreading 302
A.2 Loki s Approach 303
A.3 Atomic Operations on Integral Types 303
A.4 Mutexes 305
A.5 Locking Semantics in Object-Oriented Programming 306
A.6 Optional volatile Modifier 308
A.7 Semaphores,Events,and Other Good Things 309
A.8 Summary 309
Bibliography 311
Index 313
- 《指向核心素养 北京十一学校名师教学设计 英语 七年级 上 配人教版》周志英总主编 2019
- 《设计十六日 国内外美术院校报考攻略》沈海泯著 2018
- 《计算机辅助平面设计》吴轶博主编 2019
- 《高校转型发展系列教材 素描基础与设计》施猛责任编辑;(中国)魏伏一,徐红 2019
- 《景观艺术设计》林春水,马俊 2019
- 《高等教育双机械基础课程系列教材 高等学校教材 机械设计课程设计手册 第5版》吴宗泽,罗圣国,高志,李威 2018
- 《指向核心素养 北京十一学校名师教学设计 英语 九年级 上 配人教版》周志英总主编 2019
- 《Cinema 4D电商美工与视觉设计案例教程》樊斌 2019
- 《微笑 影印本》N.达列基作 1947
- 《通信电子电路原理及仿真设计》叶建芳 2019
- 《中国当代乡土小说文库 本乡本土》(中国)刘玉堂 2019
- 《异质性条件下技术创新最优市场结构研究 以中国高技术产业为例》千慧雄 2019
- 《中国铁路人 第三届现实主义网络文学征文大赛一等奖》恒传录著 2019
- 《莼江曲谱 2 中国昆曲博物馆藏稀见昆剧手抄曲谱汇编之一》郭腊梅主编;孙伊婷副主编;孙文明,孙伊婷编委;中国昆曲博物馆编 2018
- 《中国制造业绿色供应链发展研究报告》中国电子信息产业发展研究院 2019
- 《中国陈设艺术史》赵囡囡著 2019
- 《指向核心素养 北京十一学校名师教学设计 英语 七年级 上 配人教版》周志英总主编 2019
- 《《走近科学》精选丛书 中国UFO悬案调查》郭之文 2019
- 《清至民国中国西北戏剧经典唱段汇辑 第8卷》孔令纪 2018
- 《北京生态环境保护》《北京环境保护丛书》编委会编著 2018