Handles and use counts

2/24/99


Click here to start


Table of Contents

Handles and use counts

Overview

What is a copy?

Why do we want to copy objects?

Recall our String class

Strings are treated
as values

An example of how Strings work

Copy and assignment...

...result in new data
being allocated

Often these allocations
are unnecessary

Handles

The implementation class

The revised data structure

String_rep class

Revised String class

The String_rep operations

The String constructors

Copy Constructor

The destructor

Assignment

Assignment operator

Output

Operations on String

Compound concatenation

Operator+=

Binary concatenation

Concatenation

Conclusions

Smalltalk does it differently

Java does it differently, too

ML has a systematic approach

The root of the problem

Dealing with objects in C++

Properties of binding objects

Binding objects have many forms and names

Reminder: Proposals are
due Friday

Project Description

Presentations

Author: Andrew Koenig

Email: ark@research.att.com

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