Marko Hakkarainen
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Gallery
Posts posted by Marko Hakkarainen
-
-
Updated version.
Simpler design with single interface class for a collection and items in collection. Items can be objects of any class which inherits from Collectable interface and of course by then items can also be another collections.
Next method iterates over items in order on insertion. And Next can also be overridden to create a generator.
Collectable interface forces child class to implement data accessor methods (Read, Write) and to store the necessary class and object data.
Execute method has been removed from interface as it is not really a method of a collection.
-
I had some time to learn about new interfaces and finally I could implement my collection class as I had envisioned. I didn’t want to use iterable and iterator names, because I thought that would have been too bold a claim.
The original version of the collection class was (and is) used as a collection of sequence steps. Each element can be either a sequence command (send message, wait timer, wait complete etc.) or another collection of commands (sub-sequence). That’s the reasons for the labels and search method. Otherwise it is just a fancy (Rube Goldberg) array.
Next method is recursive and it steps through all elements in the collection. Execute is only method, which requires override.
For now, it’s at least an exercise in new interfaces. I don’t know if it’s useful enough to be in the code repository, but I can polish it up if needed.
--
Marko H
Certified LabVIEW Architect
www.optofidelity.com
Nested collection with interfaces
in Code In-Development
Posted
Thank you. "Label" of course needs to be in public scope.