Lecture 4
LECTURE 4:
Abstraction Mechanisms, Part 1
Kurt Nørmark
Department of Computer Science, Aalborg University
Title page
Abstract
References from this lecture
Exercises in this lecture
Source programs in this lecture
Page 1
Classes, structs and namespaces
Page 21
Preventing object copying
Page 2
Class basics
Page 22
Classes and Conversion
Page 3
Functions and variables outside classes
Page 23
Implicit Conversion
Page 4
Constructors
Page 24
Classes and Conversion: Examples
Page 5
Constructors - examples
Page 25
Static class members
Page 6
More about constructors
Page 26
Const member functions
Page 7
Examples of explicit, deleted, and defaulted constructors
Page 27
Const member functions - const and mutable
Page 8
Use of constructors
Page 28
Object Self-reference
Page 9
Move Constructors - C++11
Page 29
Inline member functions
Page 10
Use of move constructors
Page 30
Concrete classes
Page 11
Destructors
Page 31
Visibility and Access Control
Page 12
A class that needs a destructor
Page 32
Friends
Page 13
Resource acquisition is initialization - RAII
Page 33
Friends - Example 1
Page 14
Smart pointers in C++11: unique_ptr and shared_ptr
Page 34
Friends - Example 2
Page 15
Example use of unique_ptr and shared_ptr
Page 35
Friends - class Point - notational convenience
Page 16
Other examples of unique_ptr
Page 36
Friends - Class Point - operator friends
Page 17
About use of smart pointers in C++11
Page 37
Friends - Class Point - implicit conversion
Page 18
Copying Point objects in parameter passing
Page 38
Discussion - Encapsulation, Visibility and Access
Page 19
Example of copying objects: Default copying
Page 39
Operator overloading
Page 20
Example of copying objects: Programmed copying
Page 40
Example: Operator overloading in class Point
Generated: Tuesday August 1, 2017, 13:28:38