Hi, with the eye on supporting plugins, I'd like to add a 'tool' to the viewer: A state machine.
I'd add a base class from which others can derive their own classes. A new state machine would then be started by creating one or more objects of those types. It would be a class that supports a chain of asynchronous actions (and queries). The object would run in the main thread and be called under the "Idle" header (fasttimers). The object will know an 'idle' state (when it's waiting for data) during which it will use no significant CPU. The user (developer, you) would provide an enum with states for your object and switch between states by calling a method (ie, set_state(new_state)). If it is necessary to wait, you can call the idle() method, which will idle until data is available (detected elsewhere) causing the state machine to continue the current state. As an example, consider a series of actions like walking to a certain place, creating a prim there (or rezzing something) and then sitting on it. Or, wanting to do some calculation on a number of selected prims (for which you have to wait till all data of the selected prims has arrived). Well... the applications are limitless of course; just what plugins need ;). It won't be ALL that is needed for plugins, but it would be a good start, because this isn't wirrten/available before someone starts to write something for a plugin, the wheel will be reinvented over and over again. Any comments? :) Aleric
_______________________________________________ Policies and (un)subscribe information available here: http://wiki.secondlife.com/wiki/OpenSource-Dev Please read the policies before posting to keep unmoderated posting privileges