LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Class access scope for containing other classes

I have a measurement class that contains an array of data classes. I want that each data class is only accessable by its caller. So that when I create another child class Measurement, it cannot access the data class of its sibling class.

Here's more or less how I want to structure it.

Basjong53_1-1708592695251.png

I don't want that Measurement 2.lvclass has access to Data 1.lvclass. Is the best way to include all related classes in a library and setting the access scope of each corresponding class to private? I imagined there should be a way to handle it purely with classes. If, for example, I want to add a FileHander.lvclass, with a child for each Data class child, I want that FileHandler child to be accessed only by its corresponding Data class. and not by other Data class siblings or any Measurement classes. 

 

Is there a clean way to do this? Am I being too restrictive? Or am I handling the inheritance structure in the wrong way? Any help is greatly appreciated.

 

 

0 Kudos
Message 1 of 2
(274 Views)

@Basjong53 wrote:

I don't want that Measurement 2.lvclass has access to Data 1.lvclass.

 



How would Measurement 2 ever have access to Data 1? I'm not entirely sure what your issue is. "Data 1" and "Data 2" are both children of "Data".

 

If your composition is defined in such a way that "Measurement 2" contains an instance of "Data 2" instead of the parent "Data", then you cannot assign an instance of "Data 1" to "Measurement 2". Is this what you mean by "have access to?"

0 Kudos
Message 2 of 2
(245 Views)