In file ../include/EST_THandle.h:

template<class BoxT, class ObjectT> class EST_THandle

A `smart' pointer which does reference counting.

Documentation

A `smart' pointer which does reference counting.

Behaves almost like a pointer as far as naive code is concerned, but keeps count of how many handles are holding on to the conents and deletes it when there are none.

You need to be careful there are no dumb C++ pointers to things which are being handled this way.

Things to be handled should implement the same interface as EST_Handleable (either by taking that as a superclass or by reimplementing it) and in addition define object_ptr(). See EST_TBox for an example.

There are two parameter types. In most cases the thing which contains the reference count and the data it represents will be the same object, but in the case of boxed values it may not be, so you can specify the type of both independently.


This class has no child classes.
Friends:
int operator == (const EST_THandle< BoxT, ObjectT > &a, const EST_THandle< BoxT, ObjectT > & b)
int operator != (const EST_THandle< BoxT, ObjectT > &a, const EST_THandle< BoxT, ObjectT > & b)
ostream & operator << (ostream &s, const EST_THandle< BoxT, ObjectT > &a)
Author:
Richard Caley <rjc@cstr.ed.ac.uk>
Version:
See Also:
EST_Handleable
EST_TBox
EST_THandle:example

Alphabetic index HTML hierarchy of classes or Java


This page is part of the Edinburgh Speech Tools Library documentation
Copyright University of Edinburgh 1997
Contact: speech_tools@cstr.ed.ac.uk