名称: Exceptional C++(英文) 作者信息: 作者: Herb Sutter [ 英文 pdf ]
简单介绍
Exceptional C++ shows by example how to go about soundsoftware engineering in standard C++. Do you enjoy solving thornyC++ problems and puzzles? Do you relish writing robust andextensible code? Then take a few minutes and challenge yourselfwith some tough C++ design and programming problems. The puzzlesand problems in Exceptional C++ not only entertain, they will helpyou hone your skills to become the sharpest C++ programmer you canbe.
加上封装后的布局成本(Layout Costs for Adding Encapsulation) 1.1 C++模式模式(The C++ Object Model) 简单对象模型(A Simple Object Model) 表格驱动对象模型(A Table-driven Object Model) C++对象模型(The C++ Object Model) 对象模型如何影响程序(How the Object Model Effects Programs) 1.2 关键词所带来的差异(A Keyword Distinction) 关键词的困扰 策略性正确的struct(The Politically Correct Struct) 1.3 对象的差异(An Object Distinction) 指针的类型(The Type of a Pointer) 加上多态之后(Adding Polymorphism)
第2章 构造函数语意学(The Semantics of constructors)
2.1 Default Constructor的建构操作 “带有Default Constructor”的Member Class Object “带有Default Constructor”的Base Class “带有一个Virual Function”的Class “带有一个virual Base class”的Class 总结 2.2 Copy Constructor的建构操作 Default Memberwise Initialization Bitwise Copy Semantics(位逐次拷贝) 不要Bitwise Copy Semantics! 重新设定的指针Virtual Table 处理Virtual Base Class Subobject 2.3程序转换语意学(Program Transformation Semantics) 明确的初始化操作(Explicit Initialization) 参数的初始化(Argument Initialization) 返回值的初始化(Return Value Initialization) 在使用者层面做优化(Optimization at the user Level) 在编译器层面做优化(Optimization at the Compiler Level) Copy Constructor:要还是不要? 摘要 2.4 成员们的初始化队伍(Member Initialization List)
第3章 Data语意学(The Semantics of Data)
3.1 Data Member的绑定(The Binding of a Data Member) 3.2 Data Member的布局(Data Member Layout) 3.3 Data Member的存取 Static Data Members Nonstatic Data Member 3.4 “继承”与Data Member 只要继承不要多态(Inheritance without Polymorphism) 加上多态(Adding Polymorphism) 多重继承(Multiple Inheritance) 虚拟继承(Virtual Inheritance) 3.5 对象成员的效率(Object Member Efficiency) 3.6 指向Data Members的指针(Pointer to Data Members) “指向Members的指针”的效率问题
第4章 Function语意学(The Semantics of Function)
4.1 Member的各种调用方式 Nonstatic Member Functions(非静态成员函数) Virtual Member Functions(虚拟成员函数) Static Member Functions(静态成员函数) 4.2 Virtual Member Functions(虚拟成员函数) 多重继承下的Virtual Functions 虚拟继承下的Virtual Functions 4.3 函数的效能 4.4 指向Member Functions的指针(Pointer-to-Member Functions) 支持“指向Virtual Member Functions”之指针 在多重继承之下,指向Member Functions的指针 “指向Member Functions之指针”的效率 4.5 Inline Functions 形式对数(Formal Arguments) 局部变量(Local Variables)
第5章 构造、解构、拷贝 语意学(Semantics of Construction,Destruction,and Copy)
纯虚拟函数的存在(Presence of a Pure Virtual Function) 虚拟规格的存在(Presence of a Virtual Specification) 虚拟规格中const的存在 重新考虑class的声明 5.1 无继承情况下的对象构造 抽象数据类型(Abstract Data Type) 为继承做准备 5.2 继承体系下的对象构造 虚拟继承(Virtual Inheritance) 初始化语意学(The Semantics of the vptr Initialization) 5.3 对象复制语意学(Object Copy Semantics) 5.4 对象的功能(Object Efficiency) 5.5 解构语意学(Semantics of Destruction)
第6章 执行期语意学(Runting Semantics)
6.1 对象的构造和解构(Object Construction and Destruction) 全局对象(Global Objects) 局部静态对象(Local Static Objects) 对象数组(Array of Objects) Default Constructors和数组 6.2 new和delete运算符 针对数组的new语意 Placement Operator new的语意 6.3 临时性对象(Temporary Objects) 临时性对象的迷思(神话、传说)
第7章 站在对象模型的类端(On the Cusp of the Object Model)
7.1 Template Template的“具现”行为(Template Instantiation) Template的错误报告(Error Reporting within a Template) Template中的名称决议方式(Name Resolution within a Template) Member Function的具现行为(Member Function Instantiation) 7.2 异常处理(Exception Handling) Exception Handling快速检阅 对Exception Handling的支持 7.3 执行期类型识别(Runtime Type Identification,RTTI) Type-Safe Downcast(保证安全的向下转型操作) Type-Safe Dynamic Cast(保证安全的动态转型) References并不是Pointers Typeid运算符 7.4 效率有了,弹性呢? 动态共享函数库(Dynamic Shared Libraries) 共享内存(Shared Memory)
名称: inside the c++ object model 作者信息: 作者: Stanley B. Lippman [ 英文 pdf ]
简单介绍
Inside the C++ Object Model focuses on the underlying mechanisms that support object-oriented programming within C++: constructor semantics, temporary generation, support for encapsulation, inheritance, and “the virtuals”–virtual functions and virtual inheritance. This book shows how your understanding the underlying implementation models can help you code more efficiently and with greater confidence. Lippman dispells the misinformation and myths about the overhead and complexity associated with C++, while pointing out areas in which costs and trade offs, sometimes hidden, do exist. He then explains how the various implementation models arose, points out areas in which they are likely to evolve, and why they are what they are. He covers the semantic implications of the C++ object model and how that model affects your programs. Highlights Explores the program behavior implicit in the C++ Object Model’s support of object-oriented programming. *Explains the basic implementation of the object-oriented features and the trade offs implicit in those features. *Examines the impact on performance in terms of program transformation. Provides abundant program examples, diagrams, and performance measurements to relate object-oriented concepts to the underlying object model.
Chapter 1. Object Lessons Layout Costs for Adding Encapsulation Section 1.1. The C++ Object Model Section 1.2. A Keyword Distinction Section 1.3. An Object Distinction Chapter 2. The Semantics of Constructors Section 2.1. Default Constructor Construction Section 2.2. Copy Constructor Construction Section 2.3. Program Transformation Semantics Section 2.4. Member Initialization List Chapter 3. The Semantics of Data Section 3.1. The Binding of a Data Member Section 3.2. Data Member Layout Section 3.3. Access of a Data Member Section 3.4. Inheritance and the Data Member Section 3.5. Object Member Efficiency Section 3.6. Pointer to Data Members Chapter 4. The Semantics of Function Section 4.1. Varieties of Member Invocation Section 4.2. Virtual Member Functions Section 4.3. Function Efficiency Section 4.4. Pointer-to-Member Functions Section 4.5. Inline Functions Chapter 5. Semantics of Construction, Destruction, and Copy Presence of a Pure Virtual Destructor Presence of a Virtual Specification Presence of const within a Virtual Specification A Reconsidered Class Declaration Section 5.1. Object Construction without Inheritance Section 5.2. Object Construction under Inheritance Section 5.3. Object Copy Semantics Section 5.4. Object Efficiency Section 5.5. Semantics of Destruction Chapter 6. Runtime Semantics Section 6.1. Object Construction and Destruction Section 6.2. Operators new and delete Section 6.3. Temporary Objects Chapter 7. On the Cusp of the Object Model Section 7.1. Templates Section 7.2. Exception Handling Section 7.3. Runtime Type Identification Section 7.4. Efficient, but Inflexible?
译序(侯捷) 导读(Introduction) 基础议题(Basics) 条款1:仔细区别 pointers 和 references Distinguish between pointers and references. 条款2:最好使用 C++ 转型操作符 Prefer C++-style casts. 条款3:绝对不要以多态(polymorphically)方式处理数组 Never treat arrays polymorphically. 条款4:非必要不提供 default constructor Avoid gratuitous default constructors. 操作符(Operators) 条款5:对定制的“类型转换函数”保持警觉 Be wary of user-defined conversion functions. 条款6:区别 increment/decrement 操作符的 前置(prefix)和后置(postfix)形式 Distinguish between prefix and postfix forms of increment and decrement operators. 条款7:千万不要重载&&,||和, 操作符 Never overload &&, ||, or ,. 条款8:了解各种不同意义的 new 和 delete Understand the different meanings of new and delete 异常(Exceptions) 条款9:利用 destructors 避免泄漏资源 Use destructors to prevent resource leaks. 条款10:在 constructors 内阻止资源泄漏(resource leak) Prevent resource leaks in constructors. 条款11:禁止异常(exceptions)流出 destructors 之外 Prevent exceptions from leaving destructors. 条款12:了解“抛出一个 exception”与“传递一个参数” 或“调用一个虚函数”之间的差异61 Understand how throwing an exception differs from passing a parameter or calling a virtual function. 条款13:以 by reference 方式捕捉 exceptions Catch exceptions by reference. 条款14:明智运用 exception specifications Use exception specifications judiciously. 条款15:了解异常处理(exception handling)的成本 Understand the costs of exception handling. 效率(Efficiency) 条款16:谨记 80-20 法则 Remember the 80-20 rule. 条款17:考虑使用 lazy evaluation(缓式评估) Consider using lazy evaluation. 条款18:分期摊还预期的计算成本 Amortize the cost of expected computations. 条款19:了解临时对象的来源 Understand the origin of temporary objects. 条款20:协助完成“返回值优化(RVO)” Facilitate the return value optimization. 条款21:利用重载技术(overload)避免隐式类型转换(implict type conversions) Overload to avoid implicit type conversions. 条款22:考虑以操作符复合形式(op=)取代其独身形式(op) Consider using op= instead of stand-alone op. 条款23:考虑使用其他程序库 Consider alternative libraries. 条款24:了解 virtual functions、multiple inheritance、virtual baseclasses、 runtime type identification 的成本 Understand the costs of virtual functions, multipleinheritance, virtual base classes, and RTTI. 技术(Techniques, Idioms, Patterns) 杂项讨论(Miscellany) 索引(一)(General Index) 索引(二)(Index of Example Classes,Functions,and Templtes)
Memory and Resource Management. Item 29: Using auto_ptr (5 / 10). Item 30: Smart Pointer Members, Part 1: A Problem with auto_ptr (5 / 10). Item 31: Smart Pointer Members, Part 2: Toward a ValuePtr (6 / 10).
名称: Real-Time C++ 作者信息: 作者: Michael Kormanyos [ 英文 pdf ]
简单介绍
With this book, Chris Kormanyos delivers a highly practical guide to programming real-time embedded microcontroller systems in C++. It is divided into three parts plus several appendices. Part I provides a foundation for real-time C++ by covering language technologies, including object-oriented methods, template programming and optimization. Next, part II presents detailed descriptions of a variety of C++ components that are widely used in microcontroller programming. It details some of C++’s most powerful language elements, such as class types, templates and the STL, to develop components for microcontroller register access, low-level drivers, custom memory management, embedded containers, multitasking, etc. Finally, part III describes mathematical methods and generic utilities that can be employed to solve recurring problems in real-time C++. The appendices include a brief C++ language tutorial, information on the real-time C++ development environment and instructions for building GNU GCC cross-compilers and a microcontroller circuit.
C和C++经典著作•C++沉思录:Ruminations on C++》分为6篇32章,分别对C++语言的历史和特点、类和继承、STL与泛型编程、库的设计等几大技术话题进行了详细而深入的讨论,细微之处几乎涵盖了C++所有的设计思想和技术细节。全书通过精心挑选的实例,向读者传达先进的程序设计的方法和理念