Francois Normandin Posted June 21, 2012 Report Share Posted June 21, 2012 It's been discussed that having a typedef in the private data of a class is not recommended because of class mutation history... Would I get the same problem if one of my class member is an event with a typedef'ed enum as its datatype? The typedef'ed enum is not part of the class [edit] private data[/edit]. The event is not a typedef. What will happen to class mutation history if I add an item to my enum in a future version of the class? Quote Link to comment
Aristos Queue Posted June 22, 2012 Report Share Posted June 22, 2012 No, you would not have the same problem. The refnum is the prime type. In fact, the only problem that arises with typedefs is specifically typedefs of clusters at the top level. If you have an array of typedef of clusters, you're fine. If you have a typedef of array of clusters, fine. If you have a refnum of typedef of clusters, fine. If you have a typedef of refnum of typedef of clusters, fine. If you have a typedef of an enum or anything else, fine. Only poor top-level typedefs of clusters cause problems. Quote Link to comment
Maite Posted June 22, 2012 Report Share Posted June 22, 2012 So, if I create a class which ObjectAtributtes are typedefs (clusters), I will have problems with this class?? I just done that! Quote Link to comment
Aristos Queue Posted June 22, 2012 Report Share Posted June 22, 2012 Maite: You don't get to jump to this conclusion without looking up the backstory. :-) The key phrase in Normandin's post is "because of class mutation history". LabVIEW has help files that talk about the mutation history and there are multiple posts on LAVA about it. Check it out and see if it affects you. It's not that you can't use typedefs of clusters in your private data. It's just that if you do, one useful functionality becomes less useful. Quote Link to comment
crelf Posted June 22, 2012 Report Share Posted June 22, 2012 This is a good read: http://www.ni.com/white-paper/6316/en, then maybe read this: http://lavag.org/topic/14548-class-mutation-history Quote Link to comment
Maite Posted June 26, 2012 Report Share Posted June 26, 2012 Thanks I read about mutation, I think It won't be a problem in my case Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.