how to de-reference a handle

Hi!

In Section 2.2.2 of the "Foundation Classes"-documentation it is written that a handle must be de-referenced in order to have access to the object which it refers to. A few pages later I found the note stating "There is no (*)de-referencing operator for handles". So what else can I do to obtain the object referenced by a handle?

Nils

Gernot Knieling's picture

Hallo Nils,
I have the same question concerning handle de-referencing, do you already have solved it?
Regards,
Gernot

Stephane Routelous's picture

well, if you *really* want to de reference an Handle you can, but you will loose the reference counting. It can create big problems.
you can do :
Handle(Geom_Surface) hsurf = ...
Geom_Surface* surf = hsurf.operator->();

QbProg's picture

Don't do it :) Really! Don't de-reference an handle! At least, use a reference.

:)

Gernot Knieling's picture

Hello Thomas,
can you explain how I can use References and Handles?
I have to create a list of Handles, or a list of objects of the "handled" data type, for example Poly_Triangulation.

Regards,
Gernot