Handles and use counts
(revisited)

3/30/99


Click here to start


Table of Contents

Handles and use counts
(revisited)

Expr Interface Problems

More problems

We can do better...

How are we going to use it?

Example of usage

Declaration of Expr

Why no virtuals?

The data structure

The auxiliary data structure

General C++ strategy for such structures

Revised data structure

What classes do we need?

These classes know about each other

The class hierarchy

Private data in Expr

Declaration of ExprBase

We can start to define Expr

What about the constructors?

The ExprBase constructor

The Expr destructor

Expr copy and assignment

Implementing copy and assignment

Look familiar?

The other two constructors are simple

What about those other three classes?

Class IntExpr definition

IntExpr implementation

Class UnaryExpr definition

Implementation note

UnaryExpr implementation

BinaryExpr definition

BinaryExpr implementation

Compiling the program

Typical dependencies

An ordering that works

An alternative ordering

What about garbage collection?

Discussion

Discussion (continued)

Author: Andrew Koenig

Email: ark@research.att.com

Home Page: http://www.research.att.com/info/ark