欢迎访问学兔兔,学习、交流 分享 !

返回首页 |
当前位置: 首页 > 书籍手册>计算机与网络 >深入C++系列 深度探索 C++ 对象模型 影印版 (美)李普曼著 2003年版

深入C++系列 深度探索 C++ 对象模型 影印版 (美)李普曼著 2003年版

收藏
  • 大小:17.35 MB
  • 语言:英文版
  • 格式: PDF文档
  • 类别:计算机与网络
  • 更新日期:2024-04-25
推荐:升级会员 无限下载,节约时间成本!
关键词:深度   模型   探索   对象   C++
资源简介
深入C++系列 深度探索 C++ 对象模型 影印版
作者: (美)李普曼著
出版时间:2003年版
丛编项: 深入C++系列
内容简介
  本书重点论述了C++面向对象程序设计的底层机制,包括结构式语意,暂时性对象的生成、封装、继承和虚拟——虚拟函数和虚拟继承。书中向你表明:理解底层实现模型,可以极大地提高你的编码效率。Lippman澄清了那些关于C++系统开销与复杂性的各种错误信息和猜测,指出了其中某些成本和利益交换确实存在。他在书中详述了各种实现模型,指出了它们的发展方向以及促使其发展的根本原因。本书涵盖了C++对象模型的语意暗示,并指出了这个模型是如何对程序造成影响的。 ·探索“面向对象程序所支持的C++对象模型”中的程序行为。 ·对于“面向对象特点的基础实现技术”以及“有关这些特点的隐含利益交换”提供了一个清楚的认识。 ·检验由程序变形体带来的效率冲击。 ·提供丰富的程序范例、图表,以及面向对象概念和底层对象模型之间的效率测量。
目录
contents
1 Object Lessons l
Layout Costs for Adding Encapsulation 5
1.1 The C++ Object Model 6
A simple object model 6/ A table-driven object model 7/ The C++ object model/ How the object model effects programs
1.2 A Keyword Distinction 12
Keywords schmeewords 13 / The politically correct struct 16
1.3 An Object Distinction 18
The type of a pointer 24/ Adding polymorphism 25
2 The Semantics of Constructors 31
2.1 Default Constructor Construction 32
Member class object with default constructor 34/ Base class with default constructor 37/ Class with a virtual function 37/ Class with a virtual base class 38 / Summary 39
2.2 Copy Constructor Construction 40
Default memberwise initialization 41 / Bitwise copy semantics 43 / Bitwise copy semantics—Not! 45 / Resetting the Virtual Table Pointer 45 / Handling the Virtual Base Class Subobject 47
2.3 Program Transformation Semantics 50
Explicit initialization 50/ Argument initialization 51 / Return value initialization 53 / Optimization at the user level 54/ Optimization at the compiler level 55 / The copy constructor: to have or to have not? 59 / Summary 61
2.4 Member Initialization List 62
3 The Semantics of Data 69
3.1 The Binding of a Data Member 72
3.2 Data Member Layout 75
3.3 Access of a Data Member 72
Static data members 78 / Nonstatic data members 80
3.4 Inheritance and the Data Member 82
Inheritance without polymorphism 83 / Adding polymorphism 87/ Multiple inheritance 91 / Virtual inheritance 95
3.5 Object Member Efficiency 101
3.6 Pointer to Data Members 106
Efficiency of pointers to members 109
The Semantics of Function 113
4.1 Varieties of Member Invocation 114
Nonstatic member functions 114/ Virtual member functions 120/ Static member functions 121 /
4.2 Virtual Member Functions 124
Virtual functions under MI 131 / Virtual functions underg virtual inheritance 138
4.3 Function Efficiency 139
4.4 Pointer-to-Member Functions 144
Supporting pointer-to-virtual member functions 145 / Pointer-to-member functions under Ml 147/ Pointer-to-member efficiency 149
4.5 Inline Functions 151
Formal arguments 154/ Local variables 155
Semantics of Construction, Destruction, and Copy 151
Presence of pure virtual destructor 160/ Presence of a virtual specification 161 / Presence of const within a virtual specification 162/ A reconsidered class declaration 162
5.1 Object Construction without Inheritance 163 Abstract data type 165/ Concrete base class 168
5.2 Object Construction under Inheritance 172
Virtual inheritance 176/ The semantics of the vptr initial
ization 179
5.3 Object Copy Semantics 184
5.4 Object Efficiency 190
5.5 Semantics of Destruction 196
6 Runtime Semantics 201
6.1 Object Construction and Destruction 203
Global objects 205/ Local static objects 209/ Arrays of objects 211 / Default constructors and arrays 214
6.2 Operators new and delete 215 The semantics of new arrays 218
6.3 Temporary Objects 227 A temporary myth 235
7 On the Cusp of the Object Model 239
7.1 Templates 239
Template instantiation 241 / Error reporting within a template 244 / Member function instantiation 250
7.2 Exception Handling 254
A quick review of exception handling 256 / Exception handling support 260
7.3 Runtime Type Identification 264
Introducing a type safe downcast 266 / A type safe dynamic cast 267/ References are not pointers 269/ Typeid Operator 270
7.4 Efficient, but Inflexible 272
Dynamic Shared Libraries 272 / Shared Memory 272
Index 275
下载地址