LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I make methods which are public in a parent class into private in a child class ?

I suspect the answer to my question is probably no, but...

I have a parent class that provides several general purpose methods, I also have a child class which is intended to provide a more specific set of methods for manipulating the data in the class. As a result, calling some of the parent's methods on the child class can provide results that I'd rather not let the users of the child class have to worry about. It seemed (from my rather naive OOP experience) that the nicest way to do this would be to make access to some of the parent's public methods be private in the child class. This doesn't seem to be trivially possible.... ?
--
Gavin Burnell
Condensed Matter Physics Group, University of Leeds, UK
http://www.stoner.leeds.ac.uk/
0 Kudos
Message 1 of 2
(2,519 Views)
Hi Gavin,

Unfortuneately I don't think this can be done. You can use an overide VI to change the functionality of a method in a child class but it has to have the same scope and the method it overides.

Regards

Jon B
Applications Engineer
NI UK & Ireland
0 Kudos
Message 2 of 2
(2,495 Views)