Showing results for 
Search instead for 
Did you mean: 

GOOP child object creation

Go to solution

HI all!

I´m back with a new GOOP question in my effort to get a grip on OOP in LabVIEW.

When a child object is created in GOOP, the parent is first created (if not created before). The parents DVR is via a U32 put in Ref, but this value is then overwritten by the new U32 (DVR) for the child. Isn´t the parent DVR then lost forever? (I guess not, I must be missing something ... ).

I´ve taken the liberty of compacting the GOOP diagram below for clarity.




0 Kudos
Message 1 of 5

* The parents DVR = The parent´s DVR

0 Kudos
Message 2 of 5
Accepted by topic author CuriousSwede

Hi CuriousSwede,


Each level in the class hierarchy has its own U32 "Ref" representing the DVR to the associated attributes.

The "Ref" that is set in your diagram belongs to the private data of your child class, while the parent "New" writes the its own "Ref", which is hidden from the child class (because private). They have the same name but are private data of different classes.


If you inspect your Child class with the Context Help, you may see something like that:



So each GOOP class is an assembly of all the U32 Refs of all the levels from the top ancestor down to the child class itself.




Message 3 of 5

Thanks Raphaël,


your explanation is what I ought to have expected.

It´s just that my imagination wasn´t good enough to realize that the parent Ref in the private data of the child is hidden, and it is only the child Ref that is shown and available in the child class.

Impressive implementation to my simple mind.

0 Kudos
Message 4 of 5

… and without your help I don’t know how long it would have taken me to figure that out.

0 Kudos
Message 5 of 5