深度探索C 物件模型

2021-10-23 22:32:57 字數 4045 閱讀 9506

深度探索c++物件模型

本書目錄結構如下:

第1章 關於物件(object lessons)

加上封裝後的布局成本(layout costs for adding encapsulation)

1.1 c++模式模式(the c++ object model)

簡單物件模型(a ****** object model)

**驅動物件模型(a table-driven object model)

c++物件模型(the c++ object model)

物件模型如何影響程式(how the object model effects programs)

策略性正確的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)

深度探索C 物件模型

傳世經典書叢 深度探索c 物件模型 美 stanley b.lippman 斯坦利 b.李普曼 著 侯捷 譯 isbn978 7 121 14952 8 2012年1月出版 定價 69.00元 16開 356頁 宣傳語 如果你是一位c 程式設計師,渴望對於底層知識獲得乙個完整的了解,那麼本書正適合你...

深度探索C 物件模型

傳世經典書叢 深度探索c 物件模型 美 stanley b.lippman 斯坦利 b.李普曼 著 侯捷譯 isbn978 7 121 14952 8 2012年1月出版 定價 69.00元 16開 356頁 宣傳語 如果你是一位c 程式設計師,渴望對於底層知識獲得乙個完整的了解,那麼本書正適合你 ...

深度探索C 物件模型 關於物件

類成員 物件模型 struct和class在定義類物件的想相同的,均可以定義private public protected,但是如果要用於模板類或模板函式,只能用class struct能保證資料成員的空間布局,而class則不一定。c 支援多型的方法 class shape class circ...