For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Class by Handle should inherit from MMgt_TShared??

Anonymous's picture
Forums: 

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.
Okay?

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.