Added base class AIStateMachine.

This is the skeleton needed to implement classes that can be reused and
work together, which can perform asynchronous tasks (read: need to wait
for certain events before they can continue).

An example would be the task of waiting for a given inventory folder to
be read. This could then be used to improve the builtin AO
(automatically reading that folder when a notecard is dropped, and
continuing when the whole folder is read).

It's first use will be communication with a filepicker that runs
in a plugin.
This commit is contained in:
Aleric Inglewood
2011-05-05 16:34:38 +02:00
parent 474acdbff9
commit f6b57d956d
12 changed files with 757 additions and 6 deletions

View File

@@ -53,9 +53,11 @@ public:
protected:
// Use a list so that the callbacks are ordered in case that matters
typedef std::pair<callback_t,void*> callback_pair_t;
typedef std::pair<callback_t,void*> callback_pair_t; // callback_t is a (function) pointer. If it is NULL it means that the entry should be considered deleted.
typedef std::list<callback_pair_t > callback_list_t;
callback_list_t mCallbackList;
bool mLoopingOverCallbackList; // True while looping over mCallbackList and calling the callback_t functions (see callFunctions).
bool mNeedErase; // True when deleteFunction was called while mLoopingOverCallbackList was true.
};
extern LLCallbackList gIdleCallbacks;