diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2011-01-28 20:18:10 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2011-01-28 20:18:10 -0500 |
commit | 2bafe0dc8a2eb1d99516a4af96acc93c3541a1cd (patch) | |
tree | b444cc9bea7818d2c1cfca2aba7b67ebd134d8a6 /indra/llplugin/llpluginclassmedia.h | |
parent | 2770d6f8813b6bfef89e80dfaf091287c8c0eb4d (diff) |
Extend LLEventAPI to directly call other functions & methods.
Until now, LLEventAPI has only been able to register functions specifically
accepting(const LLSD&). Typically you add a wrapper method to your LLEventAPI
subclass, register that, have it extract desired params from the incoming LLSD
and then call the actual function of interest.
With help from Alain, added new LLEventAPI::add() methods capable of
registering functions/methods with arbitrary parameter signatures. The code
uses boost::fusion magic to implicitly match incoming LLSD arguments to the
function's formal parameter list, bypassing the need for an explicit helper
method.
New add() methods caused an ambiguity with a previous convenience overload.
Removed that overload and fixed the one existing usage.
Replaced LLEventDispatcher::get() with try_call() -- it's no longer easy to
return a Callable for caller to call directly. But the one known use of that
feature simply used it to avoid fatal LL_ERRS on unknown function-name string,
hence the try_call() approach actually addresses that case more directly.
Added indra/common/lleventdispatcher_test.cpp to exercise new functionality.
Diffstat (limited to 'indra/llplugin/llpluginclassmedia.h')
0 files changed, 0 insertions, 0 deletions