GDS(Goop Development Suite)

cancel
Showing results for 
Search instead for 
Did you mean: 

What is "None" private member in new GOOP LVClass

Solved!
Go to solution

I started trying out GOOP. What is the private data bool None good for, when creating a LVClass via GOOP? Is it just a placeholder for scripting?

 

Where is best practice to initialize private data member. Shoud I add this into the automatically created _create.vi? or should I add a Init.vi myself?

Actor Framework
0 Kudos
Message 1 of 7
(7,242 Views)

..._Create.vi is a common place to initialize object attributes (private data). But if some attribute(s) must be reset during run of the SW without destruction of the object, the initialization/reset can be done in a separate method init.vi or reset.vi or whatevername.vi. Usually such a method is added in ..._Create.vi as a sub-VI and called first time there.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
Message 2 of 7
(6,927 Views)

And regarding 'None' - I thought someone may use it as some kind of null? But I think it's just a placeholder right now 

Actor Framework
0 Kudos
Message 3 of 7
(6,921 Views)

Sorry, where this "None" is located? I don't remember anything having this name

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 4 of 7
(6,912 Views)
When creating a LVClass via GOOP a bool 'None' is added to private member cluster. As there is a Attribute1 added when creating a GOOP4 class.
Actor Framework
0 Kudos
Message 5 of 7
(6,909 Views)

Sorry, seems I did not read your first message very carefully. You ask about native LabVIEW classes. I never use GDS to work with these classes. As a fact I use them only as data-wrappers (probably similar to messages in Actor Framework) and as single function providers (same as used in Sort 1D Array.vim).

 

Anyhow, the private member None is a placeholder. It is here to avoid errors in automatically created methods .._Init.vi and CleanUp.vi.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
Message 6 of 7
(6,887 Views)
Solution
Accepted by Quiztus2

Hi,
For a native by value class you can have an empty Private Data Cluster, but for the by reference classes you have a normal Type Def cluster for storing the data, and since you can't have an empty cluster we need to add something in that cluster.
But we do that for a By Value class as well. It makes it easier for the Init and Cleanup methods if they have something to bundle and unbundle.
So the first thing you would do is to update the class private data to your needs.
If you don't need and attributes, sure then you just need to update the Init and Cleanup, but in that case you might want to use an interface.

Message 7 of 7
(6,845 Views)