Hide menu

TDDD38 Advanced Programming in C++

Lectures

Lecture 2 and 3 are given as a give a quick introduction to basic C++, actually prerequisites. If already familiar with C++11, you may concider to skip lecture 2-3, but have a look at the lecture slides.

Full size lecture slides are linked from each topic heading. [2x2] shows miniatures, 4 slides per page. Also the two larger, complete code examples used for lecture 4—5 (String) and lecture 6—7 (P-E-M-C) are linked below.

Lecture plan for study period Ht1, week 36—42



Lecture 1 
1 Sep  

Introduction and overview  [2x2]
Introduction to the course. Overview C++, orientation about course content.


Lecture 2 
3 Sep  

Basic C++ (1)  [2x2]
Overview of types (fundamental, compound, aggregates), type conversion, declarations, expression, operators, statements, characters, strings, streams, string streams, file handling, functions, parameter passing, dynamic memory handling, list initialization.


Lecture 3 
5 Sep  

Basic C++ (2)  [2x2]
Overview of types (fundamental, compound, aggregates), type conversion, declarations, expression, operators, statements, characters, strings, streams, string streams, file handling, functions, parameter passing, dynamic memory handling, list initialization.

Excercises: Aggregates and List initialization


Lecture 4 
10 Sep  

Classes (1)  [2x2]  [Code example String]
Definition, deklaration; members, data members, member functions, nested types, enumerators, static members, const member functions, mutable, inline; this (expression wich gives the address for the objekt the member function has been called for); access specification (public, protected, private), friend; implicitly defined operations on class types (member access, scope operator); special member functions (default constructor, copy constructor, copy assignment operator, destructor), compiler generated verions of the special member functions; initializers, type converting constructors, explicit, type converting operator functions; recommendations for single class design.

Excercises: Aggregates and List initialization


Lecture 5 
11 Sep  

Classes (2)  [2x2]  [Code example String]

Operator overloading  [2x2]
Rules and restrictions; member or non-member?; friend or not? Overloading, optimized versions. Guidelines and recommendations for definition and overloading of operators.

Excercises: Aggregates and List initialization  |  Smart pointer


Lecture 6 
24 Sep  

Derived classes, polymorphism, RTTI (1)  [2x2]  [Code example P-E-M-C]
Derivation/inheritance; base class/subclass; singe, multiple and repeated inheritance; public, protected and private inheritance; virtuellt inheritance (virtual); protected member access; virtual function, pure virtual function, pure specifier (=0); polymorf class, abstract class; static type, dynamic type; dynamic type control, dynamic type conversion, RTTI, dynamic_cast, typeid, type_info-objects; up-cast, down-cast, cross-cast;

Excercises: Geometric objects


Lecture 7 
25 Sep  

Derived classes, polymorphism, RTTI (2)  [2x2]  [Code example P-E-M-C]

Exception handling  [2x2]
Try-block, function-try-block, throw-expression, catch-handler; exception specification (for function), exception declaration (in handler); "catch-all" handler; bad_exception; terminate(), unexpected(), uncaught_exception(), abort(); standard exceptions (exception and subclasses); user defined exceptions; recommendations for using exceptions.

Excercises: Geometric objects


Lecture 8 
8 Oct  

Templates (1)  [2x2] Templates (1)  
Function templates, class templates; declaration, definition; template parameters, template arguments, default template parameter arguments; template instantiation, implicit instantiation, explicit instantiation; template specialization, implicit specialization, partial specialization, full specialization; function templates and overload resolution; variadic templates, parameter pack, pack expansion; type equivalence for template classes; member templates; friend and template; alias templates; dependent name; SFINAE; The name rule, reference collapsing rules, move semantics, perfect forwarding; template meta programming, type traits; compilation models for template code.


Lecture 9 
9 Oct  

Templates (2)  [2x2] Templates (2)  

Namespaces  [2x2] (if time allows)
Namespace, namespace members, anonymous namespaces, namespace alias, using declaration, using directive (using namespace).

Preprocessor  [2x2] (if time allows)
Source code inclusion, simple macros, function macros, conditional compilation.

Excercises: Policy Design for Smart Pointers  |  Character Traits


Lecture plan for study period Ht2, week 45—51



Lecture 10  
?? ???  

C++ standard library (1)
Main emphasis on containers, iterators, algorithms, function objects, and related library support.

Introduction, overview  
General overview. Containers, iterators, algorithms, function objects, utilities.

Standard containers  
Sequential containers, sequential container adaptors, ordered associative containers.

Excercises: Container Design  |  Fixed Size Container  |  Indexed Set  |  Ordered List Iterators  |  Standard Library


Lecture 11  
?? ???  

C++ standard library (2)

Iterators  
Container iterators, inserters, stream iterators.

Standard algorithms  
Algorithms (function) for operating on, e.g., containers, streams, etc.

Excercises: Container Design  |  Fixed Size Container  |  Indexed Set  |  Ordered List Iterators  |  Standard Library


Lecture 12  
?? ???  

C++ standard library (3)

Function objects, lambda expression  
Objects that can be used as functions. Important for effective use of containers and algorithms. Lambda exepressions is a way to create simple function objects. Binders, negators, function call adaptors, and standard function objects corresponding to the arithmetic, comparison, and logical operator in C++.

Excercises: Container Design  |  Fixed Size Container  |  Indexable Set  |  Ordered List Iterators  |  Standard Library


Lecture 13  
?? ???  

C++ standard library (4)

To be decided...



Page responsible: Tommy Olsson
Last updated: 2014-09-05