Lecture overview -- Keyboard shortcut: 'u'  Source programs in previous lecture -- Keyboard shortcut: 'p'  Source programs in next lecture -- Keyboard shortcut: 'n'  Course home

Source Programs
Abstraction Mechanisms, Part 1

The Note Context in the rightmost column is only shown in case an annotated program exists. - You can navigate to the annotated program via the annotated slide view (= 'the note context').

Class Point in C#.Point.csSlide context--
Class Point i C++ together with a main function - member functions defined in class definition.point1.ccSlide context--
The class design of class Point.point4.hSlide context--
Member function definitions for class Point.point4.ccSlide context--
Class Point - with in-class initializations.point5.hSlide context--
Definition of function members.point5.ccSlide context--
A class with member initializers.initializers.ccSlide context--
The Point class.point.hSlide context--
Implementation of the Point class constructors.point.ccSlide context--
The Rectangle class.rect.hSlide context--
Implementation of the Rectangle class constructors.rect.ccSlide context--
Rectangle constructors - with default initialization and subsequent assignments - BAD STYLE.rect-ass.ccSlide context--
Sample Point and Rectangle constructions.prog.ccSlide context--
The Point class - with explicit and deleted constructors.point.hSlide context--
Implementation of the Point class constructors.point.ccSlide context--
Attempting Point constructions.prog.ccSlide context--
The Point class - with explicit and defaulted constructors.point1.hSlide context--
Implementation of the Point class constructors.point1.ccSlide context--
Point constructions - now OK.prog1.ccSlide context--
Class Point with a variety of constructors.point.hSlide context--
Funny implementations of the constructors.point.ccSlide context--
Use of constructors - with local variables of class type.prog3.ccSlide context--
An additional Point construction attempt - a trap.prog2-more.ccSlide context--
An additional Point construction attempt - with use of uniform default initialization.prog2-modern.ccSlide context--
Class Point with a variety of constructors - including a move constructor.point.hSlide context--
Funny implementations of the constructors.point.ccSlide context--
Use of constructors - with local variables of class type.prog.ccSlide context--
Same program with more comments.prog-commented.ccSlide context--
Class Point with a destructor.point.hSlide context--
Implementation of the destructor that reveal its activation.point.ccSlide context--
Illustration of destructor activation when automatic variables go out of scope .prog2.ccSlide context--
Class Point - representated as a dynamically allocated array of two doubles .point.hSlide context--
Implementation of class point - with an insufficient destructor .point.ccSlide context--
A sample program with memory leaks.prog.ccSlide context--
Class Point - with a pointer representation - same as before.point.hSlide context--
Implementation of class point - now with a destructor that deallocates the Point representation.point.ccSlide context--
A sample program - now without memory leaks.prog.ccSlide context--
A class Resource and its application in the function use_resource - principles only.raii-pattern-0.ccSlide context--
A class Resource and its application in the function use_resource - compilable version.raii-pattern-1.ccSlide context--
The usual class Point - nothing of particular interest.point.hSlide context--
The usual implementation of class Point - nothing of particular interest.point.ccSlide context--
An illustration of raw pointers.raw-ptr1.ccSlide context--
An illustration of unique_ptr<Point> - same example as for raw pointers.unique-ptr1.ccSlide context--
An illustration of shared_ptr<Point> - same example as for unique_ptr<Point>.shared-ptr1.ccSlide context--
Another simple illustration of shared_ptr<Point>.shared-ptr2.ccSlide context--
Similar program with raw pointers.raw-ptr2.ccSlide context--
The usual class Point - nothing of particular interest.point.hSlide context--
The usual implementation of class Point - nothing of particular interest.point.ccSlide context--
Unique_ptr versus raw pointer.p1.ccSlide context--
Passing unique_ptr as parameter to a function.p2.ccSlide context--
Passing Point objects in and out of functions.prog5.ccSlide context--
Class LineSegment WITHOUT copy constructor and and WITHOUT assignment operator.point-lineseg.hSlide context--
The corresponding cc file - not particularly relevant.point-lineseg.ccSlide context--
A function that constructs, initializes and assigns LineSegments.prog.ccSlide context--
Class LineSegment WITH a copy constructor and and WITH an assignment operator.point-lineseg.hSlide context--
The corresponding cc file with implementations of the copy constructor and the assignment operator.point-lineseg.ccSlide context--
A function that constructs, initializes and assigns LineSegments.prog.ccSlide context--
istream conversion to bool.io-stream-1.ccSlide context--
Class Point with conversion constructor and conversion operator, from and to double.point1.hSlide context--
Class Point implementation.point1.ccSlide context--
Use implicit of the conversions.prog1.ccSlide context--
Class Tripple with Tripple(Point) constructor and a Point conversion operator.point1.hSlide context--
Class Tripple implementation.point1.ccSlide context--
Illustration of conversions.prog1.ccSlide context--
A variant of class Point with static members.point.hSlide context--
Implementation of class Point.point.ccSlide context--
A client of class Point.prog.ccSlide context--
A variant of class Point with static member function for the defaultPoint.point.hSlide context--
Implementation of class Point.point.ccSlide context--
A client of class Point.prog.ccSlide context--
A variant of Point with cached polar representation.point.hSlide context--
The implementation of class Point - with compilation problems.point.ccSlide context--
A variant of Point with cached polar representation.point.hSlide context--
The implementation of class Point - with compilation problems.point.ccSlide context--
A simple client program of Point.prog.ccSlide context--
Class Point - almost the usual header file.point.hSlide context--
Class Point - a variant with explicit use of this.point.ccSlide context--
A sample use of points, with emphasis on moving.prog.ccSlide context--
A function f get access to the private state of both class A and B.friends-sit6.ccSlide context--
Class A provides friendship to class B.friends-sit2.ccSlide context--
Class A and B are mutual friends of each other - problems in this version.friends-sit4.ccSlide context--
Class A and B are mutual friends of each other - this version is OK.friends-sit3.ccSlide context--
A variant were we want ma to be a friend of B and mb to be friend of A - problems in this version.friends-sit5.ccSlide context--
Class Point - header file.point.hSlide context--
Class Point - implementation - not important for this example.point.ccSlide context--
The program including implementation of friend moving functions.prog.ccSlide context--
Class Point - header file.point.hSlide context--
Class Point - implementation - including the implementation of operator<<.point.ccSlide context--
The program that uses the operator - nothing new here.prog.ccSlide context--
Class Point - header file.point.hSlide context--
Class Point - implementation - including the implementation of operator<<.point.ccSlide context--
The program that use the operator.prog.ccSlide context--
Class Point with operators as members.point.hSlide context--
Definition of Point member functions.point.ccSlide context--
A program that illustrates uses the Point operators.prog.ccSlide context--
Class Point with non-member operators.point.hSlide context--
Definition of Point member functions and non-member operators.point.ccSlide context--
An identical program that illustrates uses the Point operators.prog.ccSlide context--

Generated: Tuesday August 1, 2017, 13:29:21