Extended STL, Volume 1 (Paperback)
暫譯: 擴展 STL,第 1 卷(平裝本)

Matthew Wilson

  • 出版商: Addison Wesley
  • 出版日期: 2007-06-29
  • 定價: $1,925
  • 售價: 8.0$1,540
  • 語言: 英文
  • 頁數: 624
  • 裝訂: Paperback
  • ISBN: 0321305507
  • ISBN-13: 9780321305503
  • 相關分類: C++ 程式語言
  • 立即出貨 (庫存 < 4)

買這商品的人也買了...

商品描述

Description:

This book empowers programmers to take the principles and concepts of the STL into new contexts and new forms, thereby addressing a range of programming needs beyond the library's generic components. Appealing to junior and master C++ programmers alike, the book builds on their existing knowledge of, and experience with, the STL, and demonstrates techniques for applying, expanding, and extending it. The book examines three ways the STL can be extended: 1. The application of existing STL concepts to real-world, technology-specific libraries and operating system APIs. This is where the rubber meets the road for practicing programmers. 2. The expansion of existing STL concepts to a wider range of generic components. The book shows, for example, how to provide specialized components needed to increase a program's robustness or efficiency. 3. The extension of existing STL concepts into new and increasingly useful concepts, or the creation of wholly new concepts. The current STL is a valuable tool for programmers; but it's only the beginning. Most of the extended concepts presented in the book are already implemented in the STLSoft libraries, which are included on the CD-ROM.

 

Table of Contents:

Preface

Aims
Subject Matter
Structure
Acknowledgements
Parachutes: Coda

Prologue

A Dichotomy of Character
Principles of UNIX Programming
Seven Signs of Successful C++ Software Libraries
Balancing the Signs: Satisfiction, Dialecticism and Idioms Old and New
Example Libraries

Presentation Conventions

Part I: Foundations

Chapter 1: The Standard Template Library

1.1 Core Concepts
1.2 Containers
1.3 Iterators
1.4 Algorithms
1.5 Function Objects
1.6 Allocators

Chapter 2: Extended STL Concepts, or: "When STL Meets the Real World"

2.1 Terminology
2.2 Collections
2.3 Iterators

Chapter 3: Element Reference Categories

3.1 Introduction
3.2 C++ References
3.3 A Taxonomy of Element Reference Categories
3.4 Using Element Reference Categories
3.5 Defining operator ->()
3.6 Element Reference Categories: Coda

Chapter 4: The Curious Untemporary Reference

Chapter 5: The DRY SPOT Principle

5.1 DRY SPOTs in C++
5.2 Not Quite DRY SPOTs in C++
5.3 Closed Namespaces

Chapter 6: The Law of Leaky Abstractions

Chapter 7: Contract Programming

7.1 Enforcement Types
7.2 Enforcement Mechanisms

Chapter 8: Constraints

Chapter 9: Shims

9.1 Introduction
9.2 Primary Shims
9.3 Composite Shims

Chapter 10: Duck and Goose, or: "The Whimsical Bases of Partial Structural Conformance"

10.1 Conformance
10.2 Explicit Semantic Conformance
10.3 Intersecting Conformance

Chapter 11: RAII

11.1 Mutability
11.2 Resource Source

Chapter 12: Template Tools

12.1 Traits
12.2 Type Generators
12.3 True Typedefs

Chapter 13: Inferred Interface Adaptation: Compile-time Adaptation of Interface-Incomplete Types

13.1 Introduction
13.2 Adapting Interface-Incomplete Types
13.3 Adapting Immutable Collections
13.4 Inferred Interface Adaptation
13.5 Applying IIA to the Range

Chapter 14: Henney's Hypothesis, or: "When Templates Attack!"

Chapter 15: The Independent Autonomies of equal() Friends

15.1 Beware Non-member Friend Function Abuse
15.2 Containers and their Iterators

Chapter 16: Essential Components

16.1 Introduction
16.2 auto_buffer
16.3 filesystem_traits
16.4 file_path_buffer
16.5 scoped_handle
16.6 dl_call()

Part II: Collections

Chapter 17: Adapting the glob API

17.1 Introduction
17.2 Decomposition of Longhand Version
17.3 unixstl::glob_sequence
17.4 Decomposition of Shorthand Version
17.5 Summary

Chapter 18: Intermezzo #1 - Constructor Clashes and Design That Is, If Not Bad, At Least Ill-conceived for Seamless Evolution

Chapter 19: Adapting the opendir/readdir API

19.1 Introduction
19.2 Decomposition of Longhand Version
19.3 unixstl::readdir_sequence
19.4 Alternate Implementations
19.5 Summary

Chapter 20: Adapting The FindFirstFile/FindNextFile API

20.1 Introduction
20.2 Decomposition of Examples
20.3 Sequence Design
20.4 winstl::basic_findfile_sequence
20.5 winstl::basic_findfile_sequence_const_iterator
20.6 winstl::basic_findfile_sequence_value_type
20.7 Shims
20.8 What, no Shims and Constructor Templates?
20.9 Summary
20.10 File-system Enumeration With recls

Chapter 21: Intermezzo: When the Efficiency/Usability Balance is Tipped: Enumerating FTP Server Directories

21.1 inetstl::basic_findfile_sequence
21.2 inetstl::basic_ftpdir_sequence

Chapter 22: Enumerating Processes and Modules

22.1 Collection Characteristics
22.2 winstl::pid_sequence
22.3 winstl::process_module_sequence
22.4 Enumerating All Modules On A System
22.5 Avoiding the System Pseudo Processes
22.6 Handling Optional API Headers
22.7 Summary

Chapter 23: The Fibonacci Sequence

23.1 Introduction
23.2 The Fibonacci Sequence
23.3 Fibonacci as an STL sequence
23.4 Discoverability Failure
23.5 Defining Finite Bounds
23.6 Summary

Chapter 24 Adapting MFC's CArray Container Family

24.1 Introduction
24.2 Motivation
24.3 Emulating std::vector
24.4 Design Considerations
24.5 mfcstl::CArray_adaptor_base Interface
24.6 mfcstl::CArray_cadaptor
24.7 mfcstl::CArray_iadaptor
24.8 Construction
24.9 Allocator
24.10 Element Access Methods
24.11 Iteration
24.12 Size
24.13 Capacity
24.14 Comparison
24.15 Modifiers
24.16 Assignment and swap()
24.17 Summary
24.18 On The CD ...

Chapter 25: A Map Of The Environment

25.1 Introduction
25.2 Motivation
25.3 getenv(), environ, putenv() & setenv()/unsetenv()
25.4 platformstl::environment_variable_traits
25.5 Planning the Interface
25.6 Lookup by Name
25.7 Inserting, Updating and Deleting Values by Name
25.8 Iteration
25.9 Final Iteration Implementation
25.10 Heterogeneous Reference Categories?
25.11 size(), and Subscript by Index
25.12 Summary
25.13 On The CD ...

Chapter 26: Traveling Back and Forth on the Z-Plane

26.1 Prologue
26.2 Introduction
26.3 Version 1: Forward Iteration
26.4 Version 2: Bidirectional Iteration
26.5 Handling External Change
26.6 winstl::child_window_sequence
26.7 Bidirectional Iterator Blues
26.8 winstl::zorder_iterator - A Reversal of Self
26.9 Finalizing the Window Peer Sequences
26.10 Summary
26.11 Z-Plane: Coda

Chapter 27: String Tokenization

27.1 Introduction
27.2 strtok()
27.3 SynesisSTL::StringTokeniser
27.4 Tokenization Use Cases
27.5 Other Tokenization Alternatives
27.6 stlsoft::string_tokenizer
27.7 Test Drive
27.8 The Policy Folly
27.9 Performance
27.10 Summary

Chapter 28: Adapting COM Enumerators

28.1 Introduction
28.2 Motivation
28.3 COM Enumerators
28.4 Decomposition of Longhand Version
28.5 comstl::enumerator_sequence
28.6 comstl::enumerator_sequence::iterator
28.7 comstl::enumerator_sequence::iterator::enumeration_context
28.8 Iterator Cloning Policies
28.9 Choosing a Default Cloning Policy: Applying the Principle of Least Surprise
28.10 Alternative Approaches
28.11 Coming Next ...

Chapter 29: Intermezzo: Correcting Minor Design Omissions with Member Type Inference

Chapter 30: Adapting COM Collections

30.1 Introduction
30.2 Motivation
30.3 comstl::collection_sequence
30.4 Enumerator Acquisition Policies
30.5 Summary

Chapter 31: Gathering Scattered I/O

31.1 Introduction
31.2 Scatter/Gather I/O
31.3 Scatter/Gather I/O APIs
31.4 Adapting ACE_Message_Queue
31.5 Time For Some Cake
31.6 Summary

Chapter 32: Argument-dependent Return-type Variance

32.1 Introduction
32.2 Borrowing A Jewel From Ruby
32.3 Dual-semantic Subscripting in C++
32.4 Generalized Compatibility, via String Access Shims
32.5 A Fly In The int-ment
32.6 Selecting Return Type and Overload
32.7 Argument-dependent Return-type Variance: Coda

Chapter 33: External Iterator Invalidation

33.1 Element-Interface Coherence
33.2 Windows ListBox and ComboBox Controls
33.3 Enumerating Registry Keys and Values
33.4 Summary
33.5 On The CD ...

Part III: Iterators

Chapter 34: An Enhanced ostream_iterator

34.1 Introduction
34.2 std::ostream_iterator
34.3 stlsoft::ostream_iterator
34.4 Defining Stream Insertion Operators
34.5 Summary

Chapter 35: Intermezzo: Proscribing Fatuous Output Iterator Syntax using the Dereference Proxy Pattern

35.1 stlsoft::ostream_iterator::deref_proxy

Chapter 36: Transform Iterator

36.1 Introduction
36.2 Motivation
36.3 Defining Iterator Adaptors
36.4 stlsoft::transform_iterator
36.5 Composite Transformations
36.6 DRY SPOT Violations?
36.7 A Spoonful of Sequence Helps the Medicine ...?
36.8 Summary
36.9 On The CD ...

Chapter 37: Intermezzo: Discretion Being the Better Part of Nomenclature . . .

Chapter 38: Member Selector Iterator

38.1 Introduction
38.2 Motivation
38.3 member_selector_iterator
38.4 Creator Function Woes
38.5 Summary
38.6 On The CD ...

Chapter 39: C-style String Concatenation

39.1 Motivation
39.2 An Inflexible Version
39.3 stlsoft::cstring_concatenator_iterator
39.4 Creator Functions
39.5 Summary
39.6 On The CD ...

Chapter 40: String Object Concatenation

40.1 Introduction
40.2 stlsoft::string_concatenator_iterator
40.3 Heterogeneity of String Type(s)
40.4 But ...
40.5 Summary

Chapter 41: Adapted Iterators Traits

41.1 Introduction
41.2 stlsoft::adapted_iterator_traits
41.3 Summary
41.4 On The CD ...

Chapter 42: Filtered Iteration

42.1 Introduction
42.2 An Invalid Version
42.3 Member Iterators Define Range
42.4 But ... ?
42.5 stlsoft::filter_iterator
42.6 Constraining Iterator Category
42.7 Summary
42.8 On The CD ...

Chapter 43: Composite Iterator Adaptations

43.1 Transforming a Filtered Iterator
43.2 Filtering a Transformed Iterator
43.3 Hedging Our Bets
43.4 Summary

Epilogue

Bibliography
Index

商品描述(中文翻譯)

**描述**:
本書使程式設計師能夠將 STL 的原則和概念應用於新的情境和形式,從而滿足超越庫的通用組件的一系列程式設計需求。該書吸引了初級和高級 C++ 程式設計師,基於他們對 STL 的現有知識和經驗,展示了應用、擴展和延伸 STL 的技術。本書探討了 STL 擴展的三種方式:1. 將現有 STL 概念應用於現實世界的技術特定庫和操作系統 API。這是實踐程式設計師的實際應用。2. 將現有 STL 概念擴展到更廣泛的通用組件。該書展示了如何提供專門的組件,以提高程式的穩健性或效率。3. 將現有 STL 概念擴展為新的且越來越有用的概念,或創建全新的概念。當前的 STL 是程式設計師的寶貴工具;但這僅僅是開始。本書中介紹的大多數擴展概念已在 STLSoft 庫中實現,並包含在 CD-ROM 中。

**目錄**:
**前言**:
目標
主題
結構
致謝
降落傘:結尾

**序言**:
角色的二分法
UNIX 程式設計原則
成功 C++ 軟體庫的七個標誌
平衡標誌:滿意度、辯證法及新舊習語
範例庫

**呈現慣例**
**第一部分:基礎**
**第 1 章:標準模板庫**
1.1 核心概念
1.2 容器
1.3 迭代器
1.4 算法
1.5 函數物件
1.6 配置器

**第 2 章:擴展 STL 概念,或:'當 STL 遇上現實世界'**
2.1 術語
2.2 集合
2.3 迭代器

**第 3 章:元素引用類別**
3.1 介紹
3.2 C++ 引用
3.3 元素引用類別的分類
3.4 使用元素引用類別
3.5 定義運算子 ->()
3.6 元素引用類別:結尾

**第 4 章:好奇的非時效性引用**
**第 5 章:DRY SPOT 原則**
5.1 C++ 中的 DRY SPOT
5.2 C++ 中的非完全 DRY SPOT
5.3 關閉命名空間

**第 6 章:漏水抽象的法則**
**第 7 章:契約程式設計**
7.1 強制類型
7.2 強制機制

**第 8 章:約束**
**第 9 章:墊片**
9.1 介紹
9.2 主要墊片
9.3 複合墊片

**第 10 章:鴨子與鵝,或:'部分結構符合的異想天開基礎'**
10.1 符合性
10.2 明確語義符合性
10.3 相交符合性

**第 11 章:RAII**
11.1 可變性
11.2 資源來源

**第 12 章:模板工具**
12.1 特徵
12.2 類型生成器
12.3 真正的類型定義

**第 13 章:推斷介面適配:介面不完整類型的編譯時適配**
13.1 介紹
13.2 適配介面不完整類型
13.3 適配不可變集合
13.4 推斷介面適配
13.5 將 IIA 應用於範圍

**第 14 章:Henney 的假設,或:'當模板攻擊!'**
**第 15 章:equal() 朋友的獨立自主性**
15.1 當心非成員朋友函數濫用
15.2 容器及其迭代器

**第 16 章:基本組件**
16.1 介紹
16.2 auto_buffer
16.3 filesystem_traits
16.4 file_path_buffer
16.5 scoped_handle
16.6 dl_call()

**第二部分:集合**
**第 17 章:適配 glob API**
17.1 介紹
17.2 長版本的分解
17.3 unixstl::glob_sequence
17.4 短版本的分解
17.5 總結

**第 18 章:插曲 #1 - 構造函數衝突及設計,若不是壞的,至少是為無縫演進而不良的**
**第 19 章:適配 opendir/readdir API**
19.1 介紹
19.2 長版本的分解
19.3 unixstl::readdir_sequence
19.4 替代實現
19.5 總結

**第 20 章:適配 FindFirstFile/FindNextFile API**
20.1 介紹
20.2 範例的分解
20.3 序列設計
20.4 winstl::basic_findfile_sequence
20.5 winstl::basic_findfile_sequence_const_iterator
20.6 winstl::basic_findfile_sequence_value_type
20.7 墊片
20.8 什麼,沒有墊片和構造模板?
20.9 總結
20.10 使用 recls 的檔案系統列舉

**第 21 章:插曲:當效率/可用性平衡傾斜:列舉 FTP 伺服器目錄**
21.1 inetstl::basic_findfile_sequence
21.2 inetstl::basic_ftpdir_sequence

**第 22 章:列舉進程和模組**
22.1 集合特徵
22.2 winstl::pid_sequence
22.3 winstl::process_module_sequence
22.4 列舉系統上的所有模組
22.5 避免系統偽進程
22.6 處理可選 API 標頭
22.7 總結

**第 23 章:費波那契數列**
23.1 介紹
23.2 費波那契數列
23.3 費波那契作為 STL 數列
23.4 可發現性失敗
23.5 定義有限邊界
23.6 總結

**第 24 章:適配 MFC 的 CArray 容器系列**
24.1 介紹
24.2 動機
24.3 模擬 std::vector
24.4 設計考量
24.5 mfcstl::CArray_adaptor_base 介面
24.6 mfcstl::CArray_cadaptor
24.7 mfcstl::CArray_iadaptor
24.8 構造
24.9 配置器
24.10 元素訪問方法
24.11 迭代
24.12 大小
24.13 容量
24.14 比較
24.15 修改器
24.16 指派和 swap()
24.17 總結
24.18 在 CD 上 ...

**第 25 章:環境的地圖**
25.1 介紹
25.2 動機
25.3 getenv()、environ、putenv() 和 setenv()/unsetenv()
25.4 platformstl::environment_variable_traits
25.5 計劃介面
25.6 按名稱查找
25.7 按名稱插入、更新和刪除值
25.8 迭代
25.9 最終迭代實現
25.10 異質引用類別?
25.11 size(),按索引下標
25.12 總結
25.13 在 CD 上 ...

**第 26 章:在 Z 平面上來回旅行**
26.1 序言
26.2 介紹
26.3 版本 1:前向迭代
26.4 版本 2:雙向迭代
26.5 處理外部變更
26.6 winstl::child_window_sequence
26.7 雙向迭代器的藍調
26.8 winstl::zorder_iterator - 自我反轉
26.9 完成窗口對等序列
26.10 總結
26.11 Z 平面:結尾

**第 27 章:字串標記化**
27.1 介紹
27.2 strtok()
27.3 SynesisSTL::StringTokeniser
27.4 標記化用例
27.5 其他標記化替代方案
27.6 stlsoft::string_tokenizer
27.7 測試驅動
27.8 政策的愚蠢
27.9 性能
27.10 總結

**第 28 章:適配 COM 列舉器**
28.1 介紹
28.2 動機
28.3 COM 列舉器
28.4 長版本的分解
28.5 comstl::enumerator_sequence
28.6 comstl::enumerator_sequence::iterator
28.7 comstl::enumerator_sequence::iterator::enumeration_context
28.8 迭代器克隆政策
28.9 選擇默認克隆政策:應用最小驚訝原則
28.10 替代方法
28.11 接下來 ...

**第 29 章:插曲:用成員類型推斷修正小設計遺漏**
**第 30 章:適配 COM 集合**
30.1 介紹
30.2 動機
30.3 comstl::collection_sequence
30.4 列舉器獲取政策
30.5 總結

**第 31 章:收集分散的 I/O**
31.1 介紹
31.2 分散/收集 I/O
31.3 分散/收集 I/O API
31.4 適配 ACE_Message_Queue
31.5 是時候吃蛋糕了
31.6 總結

**第 32 章:依賴於參數的返回類型變異**
32.1 介紹
32.2 從 Ruby 借用一顆寶石
32.3 C++ 中的雙語義下標
32.4 通過字串訪問墊片實現的通用兼容性
32.5 int-ment 中的蒼蠅
32.6 選擇返回類型和重載
32.7 依賴於參數的返回類型變異:結尾

**第 33 章:外部迭代器失效**
33.1 元素-介面一致性
33.2 Windows ListBox 和 ComboBox 控制項
33.3 列舉註冊表鍵和值
33.4 總結
33.5 在 CD 上 ...

**第二部分**