03-13-2015 07:40 AM
Hi!
I am trying to understand interfaces usage in GDS.Here is my question: I created bunch of classes all sharing common parent (say BaseClass) and implemented ITest interface in only some of them. In runtime i have array of this classes. How can i programatically find out which of them implements ITest so i can treat it in some different way from the ones that don't implement ITest? Thanks
03-13-2015 06:48 PM
There are 2 Interface support types that are supported in the latest version of OpenGDS. If you're not using that version you only have one implementation.
This is the type I call Interface by Aggregation,this type could be an issue to use if you use By value classes though.
Now back to your question.
One way to check if a class impements an interface, is to check if all the method names the interface has exists in the class.
You can do that by checking if the VI is in memory: <Classname>.lvclass:<InterfaceMethod>.vi
BTW, I'm about to do a video presentation of these two Interface implementation.
//Mike
03-13-2015 07:33 PM
Thank you Mike
How exactly do I do that
Is there a vi that will tell me that?
Also can open gds be installed side by side with ni version?
Vlad
Sent from my iPhone
03-15-2015 06:55 PM
Soemthing like this:
OpenGDS will be sitting next to NI’s GDS, but will disable the NI’s GDS, by overwriting the Provider-ini files that tells LV which provide to load
(LabVIEW 20XX\resource\Framework\Providers\GProviders\GOOP_*.ini).
The OpenGDS is the same code base than NI’s version, but with more bug fixes and some new features, my goal is to push the latest version of OpenGDS into the NI repository.
08-04-2015 06:22 PM
Here is a demo using Interface By VI Server.
I've disconnected the Common VIs from the addons-folder, so you don't need to have GDS installed to test this.