目录(Contents).32910.1.2派生类对象结构(DerivedObjectStructure)口...33010.2访问父类成员(AccessFather'sMember)33010.2.1继承父类成员(InheritFather'sMember)33210.2.2类内访问控制(AccessControlinClass)33410.3派生类的构造(ConstructingDerivedClasses)33410.3.1默认构造(DefaultConstruction)..33410.3.2自定义构造(User-DefinedConstruction).33610.3.3拷贝构造与赋值(CopyConstruction&Assignment)33610.3.4对象构造顺序(ObjectConstructingOrder)337继承方式(InheritanceMode)10.4.·33710.4.1继承访问控制(InheritingAccessControl)**34010.4.2调整访问控制(AdjustingAccessControl)*341继承与组合(Inheritance&Composition)10.534110.5.1对象结构(ObjectStructure)34110.5.2性质差异(CharacterDifferentiation)34210.5.3对象分析(ObjectAnalysis).34410.5.4继承设计(InheritanceDesign)...34510.5.5组合设计(CompositionDesign)34710.6多继承概念(Multi-InheritanceConcept)34710.6.1多继承结构(Multi-InheritanceStructure)..34810.6.2基类成员名冲突(Base-ClassMemberNameCollision)34910.6.3基类分解(Base-ClassDecomposition)..35010.7多继承技术(Multi-InheritanceTechnology)..35010.7.1虚拟继承(VirtualInheritance)35210.7.2对象构造顺序(ObjectConstructingOrder)35210.7.3多继承评价(Multi-InheritanceEvaluation)353目的归纳(Conclusion)10.8354练习10(Exercises10),10.9356第11章基于对象编程(Object-BasedProgramming)35711.1抽象编程(AbstractProgramming)35711.1.1行为抽象(ActionAbstract)..35811.1.2数据抽象(DataAbstract)..35911.1.3数据结构(DataStructure)..36011.2编程质量(ProgrammingQuality).36011.2.1可读性(Readability)361易编程性(Programability)11.2.236211.2.3安全性(Safety)36211.2.4可维护性(Maintainability)www.TopSage.com
www.TopSage.com
XVI目录(Contents)36311.2.5可扩充性(Extensibility)36311.2.6效率(Efficiency)36511.3分析Josephus问题(AnalysistheJosephusProblem)36511.3.1问题描述(ProblemDescription)36511.3.2过程化分析(ProcedureAnalysis)..36711.3.3基于对象的分析(Object-BasedAnalysis)36811.4基于过程的解决方案(Procedure-BasedSolution)36811.4.1算法(TheAlgorithm)36911.4.2算法解释(AlgorithmExplanation)37011.4.3算法实现(AlgorithmImplementation)37211.5基于对象的解决方案(Object-BasedSolution)37211.5.1算法(TheAlgorithm)37311.5.2算法解释(AlgorithmExplanation)11.5.3算法实现(AlgorithmImplementation)..37537811.5.4程序解释(ProgramExplanation)37911.6程序维护(ProgramMaintenance)38111.7程序扩展(ProgramExtension)38411.8目的归纳(Conclusion)11.9练习11(Exercises11)385第四部分商级编程(PartIVThe Advanced Programming)388第12章多态(Polymorphism)..38812.1继承召唤多态(InheritanceSummonupPolymorphism)..38812.1.1祖孙互易的说明(ExplainingUp&DownExchanging)38912.1.2覆盖父类操作(OverrideSuperclassOperation)39112.1.3同化效应(AssimilationEffect).39212.1.4渴望多态(ThirstingforPolymorphism).39312.2抽象编程的困惑(AbstractProgrammingPerplexity)..39312.2.1类型域方案(TypeFieldsScheme):.39512.2.2破坏抽象编程(DestroyAbstractProgramming)39612.2.3渴望内在的多态(ThirstingforInnerPolymorphism)39612.3虚函数(VirtualFunction):39612.3.1,多态条件(PolymorphismCondition)39712.3.2虚函数机理(VirtualFunctionMechanism).39812.3.3面向对象的真意(Object-OrientedIntendment)..·39912.3.4虚函数的传播(SpreadingVirtualFunctions)40012.4避免虚函数误用(AvoidingMisuseofVirtualFunction)40012.4.1搞清重载与覆盖(MakingClearonOverload&Overlap)40112.4.2返回类型的例外(ExceptionofReturnType)+www.TopSage.com
www.TopSage.com
XVII目录(Contents)·40312.4.3若千限制(Restrictions)40412.5精简共性的类(SimplifyClasswithGenerality)..40412.5.1孤立的类(IsolatedClasses)....40712.5.2减少余代码(ReducingVerboseCode)12.5.3改变基类及子类(SubClassSufferedbyModifyingBase-Class).410..41012.6多态编程(PolymorphicProgramming)**41012.6.1共同基类方案(SharedBase-ClassScheme)41412.6.2自定义链表类(User-DefinedLinkedListClass)41612.6.3表现多态(PolymorphismShowing)41712.7类型转换(TypeConversions)41712.7.1动态转型(dynamic_cast)..41912.7.2静态转型(staticcast)42012.7.3常量转型(const_cast)42112.8目的归纳(Conclusion)·42212.9练习12(Exercises12)424第13章抽象类(AbstractClass)42413.1抽象基类(AbstractBase-Class).42413.1.1无意义的基类对象(NonsensicalBase-ClassObjects).42513.1.2纯虚函数(PureVirtualFunctions).42613.2抽象类与具体类(Abstract&ConcreteClasses)42913.3深度隔离的界面(DeeplyPartedInterface).42913.3.1日期的年月日版本(Year-Month-DayofDateVER)43013.3.2日期的天数版本(Day-NumberofDateVER)43213.3.3应用程序界面(ApplicationInterface)43413.4抽象类做界面(AbstractClassAsInterface).43413.4.1抽象基类方案(TheAbstractBase-ClassScheme)43513.4.2抽象基类IDate(AbstractBase-ClassIDate)*43613.4.3创建Date对象(CreatingDateObjects)43713.4.4子类Date(SubclassDate)43813.4.5应用编程(ApplicationProgramming)..44013.5演绎概念设计(DeductingConceptDesign)13.5.1面向对象的模块(Object-OrientedModule)44044013.5.2Sony类层次结构(ClassSonyHierarchy)44213.5.3Sony类定义(DefiningClass Sony)44513.5.4CreateSony类层次结构(ClassCreateSonyHierarchy)44713.5.5CreateSony的子类定义(DefiningClassCreateSony)44913.5.6应用编程(ApplicationProgramming)45113.6系统扩展(SystemExtension)www.TopSage.com
www.TopSage.com
大网XVII目录(Contents)13.6.1新添一个界面(AddingOneInterface)45113.6.2新添一种技术(AddingOneTechnology)453..45513.7手柄(Handle)45513.7.1对象指针问题(ObjectPointerProblem)45613.7.2对象指针的外套(TheCoatofObjectPointer).45713.7.3可用的手柄类(UsableHandle)45913.8目的归纳(Conclusion)·45913.9练习13(Exercises13)461第14章模板(Templates)46114.1函数模板(FunctionTemplates)14.1.1函数重载的困惑(FunctionOverloadPerplexity)46146214.1.2函数模板的定义(DefiningFunctionTemplate).46314.1.3函数模板的用法(UsingFunctionTemplates)46514.2函数模板参数(FunctionTemplateParameters)46514.2.1号苛刻的类型匹配(RigorousTypeMatch)46614.2.2数据形参(DataArguments)46614.2.3常量引用型形参(constReferenceArguments).46714.2.4号引用型形参(ReferenceArguments).468函数模板重载(FunctionTemplateOverloading)14.2.5...47014.3类模板(ClassTemplates)47014.3.1容器类的困感(ContainerClassPerplexity).47114.3.2类模板定义(ClassTemplateDefinition)472类模板的实现(ClassTemplateImplementation)14.3.3.47414.3.4模板类和类模板(TemplateClass&ClassTemplates).47514.3.5模板值参数(TemplateValueParameters)14.3.6默认模板实参(DefaultTemplateParameters)47547614.4实例化与定做(Instantiation&Specialization)47614.4.1模板实例化(TemplateInstantiation)47714.4.2定做(Specialization)·48014.4.3局部定做(PartialSpecialization)48114.5程序组织(ProgramOrganization)..48114.5.1包含方式(InclusionMode)48314.5.2分离方式(SeparationMode)48614.6模板的多态(TemplatePolymorphism)48614.6.1动多态与静多态(Dynamic&StaticPolymorphism).48614.6.2动多态编程(DynamicPolymorphismProgramming)48914.6.3静多态编程(StaticPolymorphismProgramming)14.6.4动静多态的差异(Dynamic&StaticPolymorphismDifferentiation)..490www.TopSage.com
www.TopSage.com
XIX目录(Contents)49014.7高级编程(AdvancedProgramming)14.7.1动多态设计模式(DynamicPolymorphismDesignPatterns)"490...49214.7.2静多态设计模式(StaticPolymorphismDesignPatterns)49414.7.3泛型编程(GenericProgramming)49614.8目的归纳(Conclusion)·49614.9练习14(Exercises14)498第15章异常(Exception)·49815.1错误处理的复杂性(ErrorProcessingComplexity)49815.1.1错误种类(KindsofErrors)49915.1.2模块的隔绝性(IsolatedModular)50015.1.3调用链的率制(Call-Link'sHolddown)....50215.2使用异常(UsingException)50315.2.1异常使用三部曲(ThreeStepsonUsingException)50315.2.2退化为普通错误处理(BecomingGeneralErrorHandling)50415.2.3跨越函数的异常处理(SuparioFunctionExceptionHandling)50515.2.4标准异常的用法(UsingStandardException)50615.3捕捉异常(CatchingException)50615.3.1类型匹配(TypeMatch)50815.3.2撒网捕捉(ExceptionCatchNet)51115.4异常的申述(ExceptionDescription).51115.4.1申述异常(DescriptionException)..51415.4.2捉不住处理(UncaughtHandling)..51515.5异常继承体系(ExceptionInheritanceSystem)51515.5.1异常类层次结构(ExceptionClassHierarchy).51615.5.2异常类层次结构的用法(UsingExceptionClassHierarchy)51915.6异常的应用(ExceptionApplications)51915.6.1构造函数的错误处理(ConstructorErrorProcessing)..52115.6.2引用的动态转型(Referencedynamic_cast)52215.6.3typeid的用法(Usingtypeid)52315.7非错误处理(Non-ErrorProcessing)52315.7.1另一种循环控制法(AnotherLoopControlling)52515.7.2递归控制法(RecursiveControlling)*52615.8目的归纳(Conclusion)15.9练习15(Exercises15)...527附录(Appendices)532附录A语法导读(GuidetoGrammar)532A.1C++语言文法(C++LanguageGrammar)www.TopSage.com
www.TopSage.com