Advanced C++ Programming
Revision: TE2203_20081006
- Course Length:
- 5 Days
- Course Description:
- This course broadens the skills of a C++ language programmer by examining sophisticated C++ concepts such as templates, exceptions, memory management, advanced inheritance issues, disambiguation of overloaded functions, private and protected inheritance, binary I/O and class libraries.
- Who Should Attend:
- This course is for anybody who has programmed in C++ and wishes to enhance their knowledge of the language.
- Benefits of Attendance:
-
Upon completion of this course, students will be able to:
- Differentiate between global functions, friend functions and member functions.
- Code their own memory management routines by overloading operators new and delete.
- Write classes and functions with parameterized types.
- Understand and handle exceptions in C++ programs.
- Disambiguate data and functions using multiple inheritance.
- Understand the difference between various kinds of inheritance.
- Use pointers to class member functions.
- Understand the C++ mechanism to resolve overloaded functions.
- Prerequisites:
- Students should have completed an introductory C++ programming course or have equivalent knowledge.
- Course Outline:
-
- Chapter 1: What You Should Already Know - A Review
- Rationale for a New Programming Language
- The Language of Object-Orientation
- A Typical C++ Class
- Issues Regarding Member Functions vs. Non-Member Functions
- friend or non-friend
- Functions Returning References
- Relationships
- Initialization Lists
- Inheritance In C++
- Access Levels
- Simple C++ I/O
- The Many Uses of const
- Chapter 2: Parameterized Types - Templates
- Templates
- Overloading Functions
- Template Functions
- Specializing a Template Function
- Disambiguation Under Specialization
- Template Classes
- Instantiating a Template Class Object
- Rules for Template Classes
- A Non-Member Function with a Template Argument
- Friends of Template Classes
- Templates with Multiple Type Parameters
- Comments Regarding Templates
- Chapter 3: Relationships of all Kinds
- Uses of Member Initialization Lists
- Member Initialization Lists Under Composition
- Initialization Lists Under Inheritance
- Initialization Lists With Multiple Inheritance
- Initialization Lists with Multiple Inheritance and Composition
- Efficiency
- operator= and Composition
- Constructors and Composition
- What is not Inherited?
- operator=, Construction, and Inheritance
- Public Inheritance
- virtual Functions
- A Shape Class Hierarchy
- Polymorphism
- Pure Virtual Functions
- Abstract Base Classes
- Private Inheritance
- using Relationships
- Associations
- Chapter 4: Multiple Inheritance (MI)
- Multiple Inheritance
- Ambiguities
- virtual Base Classes
- The Dominance Rule
- Member Initialization Lists
- operator=
- Chapter 5: Data Structures
- Introduction
- A Simple List
- Layering Type-safe Classes Upon List
- A template List Class
- Iterators
- A template Iterator
- Stack and Queue Classes
- Templates and Inheritance
- Chapter 6: Function Pointers
- Why Have Function Pointers?
- Passing Functions as Arguments
- Registering Functions
- Function Pointers in C++
- Callback Functions
- A Class with a Callback Object
- Registration of Exception Handlers
- Chapter 7: Exceptions
- What Are Exceptions?
- Traditional Approaches to Error Handling
- try, catch, and throw
- A Simple Exception Handler
- Multiple catch Blocks
- The Exception Specification List
- Rethrowing an Exception
- Cleanup
- Exception Matching
- Inheritance and Exceptions
- Resource Allocation
- Constructors and Exceptions
- Destructors and Exceptions
- Catch by Reference
- Standard Exceptions
- Chapter 8: The C++ Standard Template Library
- Introduction
- The Standard Template Library
- Design Goals
- STL Components
- Iterators
- Example: vector
- Example: list
- Example: set
- Example: map
- Example: find
- Example: merge
- Example: accumulate
- Function Objects
- Adaptors
- Chapter 9: Disambiguation
- Conversion
- int Conversion
- float + double Conversions
- Arithmetic and Pointer Conversion
- Inheritance Based Conversion
- Overloaded Functions
- Exact Match
- Match with Promotion
- Match with Standard Conversion
- User Defined Conversion
- Constructors as Conversion Operators
- Ambiguities
- Chapter 10: I/O
- Introduction
- Manipulators
- Writing Your Own Manipulators
- Overloading the I/O Operators
- Disk Files
- Reading and Writing Objects
- Internal Transmission of Data
- A Spell Checker
- Handling Streams in the Constructor and Destructor
- Treating a File as an Array
- Example
- Chapter 11: Miscellaneous Topics
- Namespaces
- Use Counts
- Reference Counts
- RTTI
- Casts
- Having a Limited Number of Objects
- Smart Pointers
- Chapter 1: What You Should Already Know - A Review













