Advanced C ++ Programming
Course Description
This training course designed for C++ programmers. The advanced course provides techniques to build efficient, extensible and manageable C++ applications. The course covers techniques for reference counting, bridge building and dynamic typing; advanced use of pointers including pointers to class members and managed pointers; namespaces; run-time type identification; exception management; and memory management. Extensive coverage is also given to
C++ templates and standard template library. Through many worked examples, the course presents design rationales for operator overloading and proper object construction/destruction. Principles are presented to help manage class
consistency, completeness, reuse, robustness and performance.
C++ templates and standard template library. Through many worked examples, the course presents design rationales for operator overloading and proper object construction/destruction. Principles are presented to help manage class
consistency, completeness, reuse, robustness and performance.
Course Duration
4 days
Course Objectives
On completion of this course delegates will:
• understand the syntax and usage of special language features including namespaces, RTTI and the family of casting operators;
• understand how to overload operators as members of a class or as friend functions, and in what situations should each one be used;
• understand the issues relating to using const and mutable declarations and how such declarations would increase the program safety;
• apply proper design to object construction/ destruction including copy constructors and virtual destructors;
• understand the power and subtle aspects of the template model, including default instantiation, partial specialization, and template scope rules;
• understand the power and issues of exceptions, including resource acquisition and release, exception declarations, & termination semantics;
• understand memory management, including interoperability of class libraries and run-time issues of heap distribution and/or fragmentation;
• understand the syntax and purpose of pointer to class members, and be able to use them in object call-back
mechanisms;
• understand how to build generic programs, how to decouple components using functions, how to benefit from compile time optimization, and how to exploit the generic components of the C++ standard library;
• understand the syntax and usage of special language features including namespaces, RTTI and the family of casting operators;
• understand how to overload operators as members of a class or as friend functions, and in what situations should each one be used;
• understand the issues relating to using const and mutable declarations and how such declarations would increase the program safety;
• apply proper design to object construction/ destruction including copy constructors and virtual destructors;
• understand the power and subtle aspects of the template model, including default instantiation, partial specialization, and template scope rules;
• understand the power and issues of exceptions, including resource acquisition and release, exception declarations, & termination semantics;
• understand memory management, including interoperability of class libraries and run-time issues of heap distribution and/or fragmentation;
• understand the syntax and purpose of pointer to class members, and be able to use them in object call-back
mechanisms;
• understand how to build generic programs, how to decouple components using functions, how to benefit from compile time optimization, and how to exploit the generic components of the C++ standard library;
Course Content
C++ Review
Introduction to Object Oriented C++ with inheritance, polymorphism, and dynamic inheritance
Object Construction
Safe construction of objects, the principle of ‘resource acquisition is initialisation’, constructors as conversion operators, copy construction (when and why?), explicit constructors, destructors and virtual destructors
Inheritance and Polymorphism
Inheritance (uses and misuses), design of polymorphic classes, the class v-tables, virtual and pure virtual functions, multiple inheritance – the power, multiple inheritance – the problems
The Correct Use of const
The meaning of const and mutable declarations, using, constant conversion (promotion), constant formal arguments and return values, const in member functions, const references
Namespaces and Exception Handling
Modular design with namespaces, program design with exceptions, designing exception-safe programs, avoid object slicing
Operator Overloading
Overloading operators with member and friend functions, when to use each technique, overloading unary and
binary operators, overloading assignments, operator arguments and return types
Memory Management
Using advanced memory management techniques, new casting operators, run time type identification RTTI, auto
pointers, smart pointers and managed pointers, overloading the new and delete operators
Templates
Template classes and functions, inheriting from template classes, parameterised types, template specialisation and partial instantiation
STL Building Blocks
Iterators, functors, adaptors, traits algorithms and containers
C++ Standard Library (STL)
Programming with the STL, sequence and associative containers, using allocators, choosing the right container
Object Member Pointers
Traditional pointers versus pointers to members, member pointer operators, applying member pointers, member
pointers in derived classes
Introduction to Object Oriented C++ with inheritance, polymorphism, and dynamic inheritance
Object Construction
Safe construction of objects, the principle of ‘resource acquisition is initialisation’, constructors as conversion operators, copy construction (when and why?), explicit constructors, destructors and virtual destructors
Inheritance and Polymorphism
Inheritance (uses and misuses), design of polymorphic classes, the class v-tables, virtual and pure virtual functions, multiple inheritance – the power, multiple inheritance – the problems
The Correct Use of const
The meaning of const and mutable declarations, using, constant conversion (promotion), constant formal arguments and return values, const in member functions, const references
Namespaces and Exception Handling
Modular design with namespaces, program design with exceptions, designing exception-safe programs, avoid object slicing
Operator Overloading
Overloading operators with member and friend functions, when to use each technique, overloading unary and
binary operators, overloading assignments, operator arguments and return types
Memory Management
Using advanced memory management techniques, new casting operators, run time type identification RTTI, auto
pointers, smart pointers and managed pointers, overloading the new and delete operators
Templates
Template classes and functions, inheriting from template classes, parameterised types, template specialisation and partial instantiation
STL Building Blocks
Iterators, functors, adaptors, traits algorithms and containers
C++ Standard Library (STL)
Programming with the STL, sequence and associative containers, using allocators, choosing the right container
Object Member Pointers
Traditional pointers versus pointers to members, member pointer operators, applying member pointers, member
pointers in derived classes
Who should attend?
This course is about programming style and design idioms, and is intended to introduce advanced skills to experienced programmers.
Pre-requisites
Candidates must have a solid understanding of the C++ programming language and OO Design, Data Structures & Algorithms.