G#

cancel
Showing results for 
Search instead for 
Did you mean: 

Static method with same name in derivative class

Hey guys,

I'm interested, is it possible to have static method in derrivative class with the same name, as in base class?

0 Kudos
Message 1 of 4
(5,891 Views)

Hi,

Since G# very simply could be explained as a native LV class with a DVR structure placed in the private class data, all inheritance rule comes from how native LabVIEW classes works. This means you can't have a method with the same name in a subclass as in the base class unless it is set as dynamic dispatch (i.e virtual). In G# there can't  be any virtual static methods- Therefore static or not static doesn't really matter since LabVIEW doesn't care about the differernce. All it see is its VI name and scope.

/Mattias

Message 2 of 4
(4,807 Views)

So as I understand, the non modifying class method, is only a template, right? No native usage.

0 Kudos
Message 3 of 4
(4,807 Views)

Yes, it is. From a LabVIEW point of view the only difference to a non-static method is the lack of class control and since they are not present it is impossible to make it dynamic dispatch and thereby impossible to define another VI with the same name in the class hierarchy due to how LabVIEW classes works.

0 Kudos
Message 4 of 4
(4,807 Views)