Class by Handle should inherit from MMgt_TShared??

I always thought that all class that can be manipulated by handle should inherit from MMgt_TShared. Then when I subclass the class TDocStd_Application I realized that this class doesn't inherit from MMgt_TShared and it is manipulated by handle (see the example in OCAF User's Guide section 4.2.1, and have a look at the include file). Then I look back in the manual Programming Samples Volume I (version 2.1), where it says that handle are used with objects inheriting from MMgt_TShared (page 2-3, 2-4). And then, in the Foundation Classes User's Guide (for version 3.0, page 25) it says that in order to benefit from the memory manager and reference counter (which is the handle), class should inherit from Standard_Transient...

So now, in version 3.0 we should inherit future handle manupilated class from Standard_Transient?? Why this has changed?? It doesn't cause any problem, I'm just curious... Thanks you. Francois.

Robert Boehne's picture

Matra people: correct me if I'm wrong.
The basic functionality of the Handle is provided by Standard_Transient, and MMgt_TShared inherits from it.
TDocStd_Application used Standard_Transient as a base class, but you have to go down a few classes to find it. As a rule you should use MMgt_TShared as a base class for manipulating by handles, but you can use Standard_Transient if you don't need or want the additional things that MMgt_TShared provides.