07-05-2018 08:20 AM
If you understood Olli's post he's basically saying that the state pattern changes the actor object in the shift register (as you transition one state to another). That is what provides the dynamic dispatch which replaces the old conditional logic. The response to any given message depends on what state the actor is in (ie. which child class is loaded into the shift register).
Hopefully that is clear. It sounds like that is what you want to do. You can certainly use a helper loop, but I think the state pattern actor is a more elegant solution if you can wrap your head around it.
07-05-2018 09:28 AM
yes, I got state pattern, I downloaded and will try to use it.
I am trying to use also other "application" of AF, for example to make a publish-subscribe and "central actor", where the hierarchy is kinda broken (you end up passing around the enqueuers).
07-05-2018 01:27 PM
@Taggart wrote:
If you understood Olli's post he's basically saying that the state pattern changes the actor object in the shift register (as you transition one state to another).
To be more exact: there is no shift register.
You have an Actor representing an abstract state (Context Actor). The concrete states are child classes of this Actor. So each time, you change states, Actor Core.vi of the current state object is kinda ripped out and replaced by Actor Core.vi of the new state.
07-06-2018 09:10 AM
WOW
I found so valuable pptx and videos on the NI WEEK 2018 section
go here
https://learn.ni.com/center-of-excellence
so much value