Data Abstraction and Structures Using C++ Headington and Riley Chapter 3 Data Abstraction Through Classes

2/24/99


Click here to start


Table of Contents

Data Abstraction and Structures Using C++ Headington and Riley Chapter 3 Data Abstraction Through Classes

PPT Slide

Data Abstraction is . . .

Data Abstraction

Abstract Data Type

Using typedef

Using struct

mySelf

struct type declaration

struct type declaration

Abstract Data Type (ADT)

ADT Specification Example

To implement an ADT means

Using class

Benefits of information hiding

class TimeType Specification

Use of C++ data type class

Member functions categorized by task

Client Code Using TimeType

class type declaration

C++ Data Type class represents an ADT

Aggregate class operations

2 separate files generally used for class type

Implementation file for TimeType

Member selection operator .

Familiar Class Instances

Scope Resolution Operator ( :: )

PPT Slide

const member functions

A const member function

Class Constructors

Specification of TimeType Class Constructors

Implementation of TimeType Default Constructor

Implementation of Another TimeType Class Constructor

Automatic invokation of constructors occurs

Array of class objects

PPT Slide

Client Code Using JarType

Class Invariant

// CLASSINV

PPT Slide

PPT Slide

Equal implemented as a member function

friend functions

PPT Slide

Equal implemented as a friend function

Aside from . and =

Operator overloading

PPT Slide

operator== implemented as a member function

PPT Slide

operator+ implemented as a member function

2 ways to use overloaded operator+

Author: Sylvia Sorkin

Email: ssorkin@essex.cc.md.us

Home Page: http://www.essex.cc.md.us/Essex/People/ssorkin/index.html

Download presentation source